//tealium universal tag - utag.loader ut4.48.202508160121, Copyright 2025 Tealium.com Inc. All Rights Reserved. var utag_condload=false;window.__tealium_twc_switch=false;try{ try{ // Version 1.2.3 // Environment Variables window.digitalData = window.digitalData || {}; window.digitalData.environmentVariables = window.digitalData.environmentVariables || {}; window.digitalData.environmentVariables.env = window.bactm_envSelector || 'prod'; window.digitalData.environmentVariables.glassboxProfiles = { credit_cards: { domRecordEnabled: true, domTamperingDetectionEnabled: true, ajaxRecordResponseBody: "uriMatches(\S*/apply-now-services/credit-cards/rest/icai-confirmation/v1/init-data|\S*/apply-now-services/credit-cards/rest/icao-consumer-confirmation/v1/init-data|\S*/apply-now-services/credit-cards/rest/consumer-confirmation/v1/init-data)", maskWhitelistValueById: [ "oid", "customerAddressCity", "customerAddressState", "customerAddressInput" ], domBlacklistMaskContentById: [ "contactDetails", "personalInfo", "income" ], domBlacklistMaskContentByClass: [ "reviewEditSection--identity", "reviewEditSection--info", "reviewEditSection--income", "reviewEditSection--additional", "chat__message" ], captureGlobalObjects: [ "digitalData.user.name.first", "digitalData.user.name.last", "cm.campaignId", "cm.gc", "cm.creditProductName", "cm.orderID", "digitalData.product.0.productInfo.productName", "digitalData.user.online_id", "digitalData.environmentVariables.env", "digitalData.cart.attributes.applicationId" ] }, USA_Application: { domRecordEnabled: true, domTamperingDetectionEnabled: true, domMaskedAttributes: ["data-value-unmasked"], domMaskAttributesByTag: ["SPAN"], ajaxRecordRequestBody:"never", ajaxRecordRequestHeaders:"always", ajaxRecordResponseBody:"uriMatches(\/apply-now-services\/iaoconsumer\/.*?\/usa\/.*?\/init-data\/)", ajaxRecordResponseHeaders:"always", BofAGBVersionInfo: "OLBUSACardAndDep_LLE_ver7_MayRelease", valueMaskingMode:"blacklist", maskBlacklistValueById: [ "dateOfBirth", "pinNumber", "reenterPinNumber", "ssn", "reEnterSsn", "ssnOrItin", "reEnterSsnOrItin", "coappResidentAlienItin", "coappResidentAlienReEnterItin", "passportNumber", "residentAlienItinId", "residentAlienReEnterItinId", "applicantDateOfBirth", "applicantSsn", "applicantSsnOrItin", "applicantPassportNumber", "coApplicantDateOfBirth", "coApplicantSsn", "coApplicantSsnOrItin", "coApplicantPassportNumber", "debitCardNumber", "securityCode", "cardAccountNumber-1", "routingNumber", "reEnterRoutingNumber", "accountNumber", "reEnterAccountNumber" ], captureGlobalObjects: [ "digitalData.page.attributes.chat.SITE_ID","digitalData.page.attributes.chat.account_type", "digitalData.cart.applicationID" ], }, USB_Associate: { domRecordEnabled: true, domTamperingDetectionEnabled: true, ajaxRecordRequestBody:"never", ajaxRecordRequestHeaders:"always", ajaxRecordResponseBody:"never", ajaxRecordResponseHeaders:"always", BofAGBVersionInfo: "OLB_USB_Associtate_LLE_ver1_June6th2025", valueMaskingMode: "whitelist", domMaskingMode: "whitelist", }, USB_action_center: { domRecordEnabled: true, domTamperingDetectionEnabled: true, ajaxRecordRequestBody:"always", ajaxRecordRequestHeaders:"always", ajaxRecordResponseBody:"always", ajaxRecordResponseHeaders:"always", BofAGBVersionInfo: "OLB_USB_Consumer_LLE_ver1_June6th2025", valueMaskingMode: "blacklist", domMaskingMode: "blacklist", } }; // Vtim Configurations window.vtimConfigs = window.vtimConfigs || {} window.vtimConfigs.oneTrust = {}; window.vtimConfigs.oneTrust.oneTrustDomainConfig = [ { domain: "https://about.bankofamerica.com", domain_id: "c8ce66dd-de59-4db7-bfe9-391cec77a89e", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://acfr.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://admin.applyonlinenow.com", domain_id: "0fedbb0b-cda5-44d3-bd08-8efc72c81e0c", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://admin.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://advisor.ml.com", domain_id: "019295aa-488f-7b0c-9a5b-12164713bd44", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://ah-ic.bankofamerica.com", domain_id: "72e99fdc-3ef1-452a-9b02-e35228fa4504", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://api.bankofamerica.com", domain_id: "72e99fdc-3ef1-452a-9b02-e35228fa4504", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://auth.accountmanagement.bofa.com", domain_id: "0196498f-555a-7cd0-b869-4517a8eab06f", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://auth.privatebank.bankofamerica.com", domain_id: "0191fc12-4e25-7343-a4d6-d20a69847232", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://bactravelcenter.bankofamerica.com", domain_id: "72e99fdc-3ef1-452a-9b02-e35228fa4504", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://baml.bankofamerica.com", domain_id: "13aae0c1-64ef-43a0-a248-20e63ee6bf47", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://bankers.bankofamerica.com", domain_id: "01942d31-86ad-7bb3-a802-195607ec7b47", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://bettermoneyhabits.bankofamerica.com", domain_id: "4fb6b66c-015b-4e57-ad18-9852b4db9a56", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://billpay-ui.bankofamerica.com", domain_id: "019494b5-3769-7e4a-ab8a-e092d0720758", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://business.bankofamerica.com", domain_id: "83a17500-74ff-49e0-8824-f56ffc1285d9", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://business.bofa.com", domain_id: "ec6218f2-91f4-4a5c-8d9c-3aa3205355c7", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://businesscards.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://campus.bankofamerica.com", domain_id: "6c8fa49f-85fa-4302-a86b-4421dca23b11", sri_hash: "sha384-Pm7zkzl1ccyaaPNigM8OuqoiW4wgQzmDDOvUVEsF9klxpQLcDaF5ffF1oeoePXsC" }, { domain: "https://card.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://cardoffer.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://careers.bankofamerica.com", domain_id: "248fa229-5274-4779-bb37-7749fce8e4f2", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://cashback.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://connectedbusinessapps.bankofamerica.com", domain_id: "019295b0-e248-77b5-9ec9-1ac092456fd5", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://consolejc.olint.services.fs.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://consumersales.bankofamerica.com", domain_id: "72e99fdc-3ef1-452a-9b02-e35228fa4504", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://dataservicesapi.bankofamerica.com", domain_id: "0194d264-7435-7f44-8275-9b30e1757fd9", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://de.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://de.mybenefits.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://ees.bankofamerica.com", domain_id: "72e99fdc-3ef1-452a-9b02-e35228fa4504", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://employeeinfo.bankofamerica.com", domain_id: "72e99fdc-3ef1-452a-9b02-e35228fa4504", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://es-locators.bankofamerica.com", domain_id: "1a9bd132-777a-4ed8-ab24-e63f2dbfe971", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://es.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://es.mybenefits.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://fa.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://foreclosures.bankofamerica.com", domain_id: "018f827d-a902-7775-b289-438ce89ec8aa", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://fr-ca.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://fr-ca.mybenefits.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://fr.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://fr.mybenefits.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://fsa.merrill.com", domain_id: "34791c58-9c6f-49e5-8911-16fadc3a5e3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://healthaccounts.bankofamerica.com", domain_id: "c93c1028-3240-4324-91ec-1b163e699e3a", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://homeloanhelp.bankofamerica.com", domain_id: "d70024ca-5cf2-4678-983f-2f543baebb96", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://homeloans.bankofamerica.com", domain_id: "018df666-052c-789a-8c6b-6b16020ced95", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://homevaluerealestatecenter.bankofamerica.com", domain_id: "018f827f-49ac-75dc-8c2e-38e6565de68d", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://images.em.bankofamerica.com", domain_id: "72e99fdc-3ef1-452a-9b02-e35228fa4504", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://info.bankofamerica.com", domain_id: "018e624f-9807-760f-941f-639b6059c782", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://institute.bankofamerica.com", domain_id: "07904641-0a05-43c2-9d44-c3a31fefcac4", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://interviews.bankofamerica.com", domain_id: "d0fd1ce6-a909-4e85-aebb-0584bada3442", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://interviewscheduler.bankofamerica.com", domain_id: "267a626d-2568-4f7e-a454-7c96374e372c", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://investor.bankofamerica.com", domain_id: "019295a6-4e0d-73ff-abad-b873c88e2f71", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://it.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://it.mybenefits.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://itadmin.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://ja.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://ja.mybenefits.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://loans.bankofamerica.com", domain_id: "72e99fdc-3ef1-452a-9b02-e35228fa4504", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://local.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://locators.bankofamerica.com", domain_id: "1a9bd132-777a-4ed8-ab24-e63f2dbfe971", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://m.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://m.mybenefits.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://meet.bofa.com", domain_id: "01946049-0906-76f6-b8cf-dbe49efee95f", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://merchanthelp.bankofamerica.com", domain_id: "019295af-15e7-70c3-beb8-373b25733eec", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://merrillplus.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://message.bankofamerica.com", domain_id: "72e99fdc-3ef1-452a-9b02-e35228fa4504", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://mobile.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://mortgage.bankofamerica.com", domain_id: "019295a4-d6a9-7f5d-abd3-6094ba55dff8", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://mservice-helix.ecnp.bankofamerica.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://mservice.bankofamerica.com", domain_id: "72e99fdc-3ef1-452a-9b02-e35228fa4504", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://mtravelcenter.bankofamerica.com", domain_id: "72e99fdc-3ef1-452a-9b02-e35228fa4504", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://mybenefits.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://myfinancialpicturepfm.bankofamerica.com", domain_id: "72e99fdc-3ef1-452a-9b02-e35228fa4504", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://myfinancialpicturepfm.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://myfinancialpicturepfm.ml.com", domain_id: "019291f5-dbb6-726d-a0e2-f0f6c0969428", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://myfinancialpicturepfm.privatebank.bankofamerica.com", domain_id: "0191fc13-5364-79cc-b7fa-539cdee1a382", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://mynewcard2.bankofamerica.com", domain_id: "018e8642-19ae-71bc-9b34-fc2bc0fb5cff", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://newsroom-cont.bankofamerica.com", domain_id: "95b7d404-c383-4e05-8729-0ea64ec736e8", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://newsroom-prod.bankofamerica.com", domain_id: "95b7d404-c383-4e05-8729-0ea64ec736e8", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://newsroom.bankofamerica.com", domain_id: "95b7d404-c383-4e05-8729-0ea64ec736e8", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://nl.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://nl.mybenefits.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://nonprofitcards.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://oaui.fs.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://olui2.fs.ml.com", domain_id: "69963c1c-f710-4cac-a495-811ce6cdc604", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://optionnavigator.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://origin-business.bankofamerica.com", domain_id: "83a17500-74ff-49e0-8824-f56ffc1285d9", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://preferences.em.bankofamerica.com", domain_id: "01929592-b91c-70ea-85a1-11227e427cd2", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://private.bankofamerica.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://privatebank.bankofamerica.com", domain_id: "0193acf0-f85f-7fe1-a10a-0abf77eb7a5a", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://promo.bankofamerica.com", domain_id: "65d20e65-1c63-4649-a9fe-fe881b7397df", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://promotions.bankofamerica.com", domain_id: "6ba00e9c-679a-491c-bd2d-7c496f18a053", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://prv.admin.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://prv.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://pt-br.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://pt-br.mybenefits.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://pub3.ims.bankofamerica.com", domain_id: "018e1a99-4fe7-78d5-848e-601dfceb4ed9", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://pwa.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://realestatecenter.bankofamerica.com", domain_id: "019291fc-f2a7-779f-bde6-1e32edb2518e", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://rewards.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://rg.ml.com", domain_id: "efeb262a-bf37-4f49-a5e7-dd1cfcc0a560", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://rm.bofaml.com", domain_id: "0192959e-9570-7f99-843e-703626b1a764", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://rpt.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://sbbankers.bankofamerica.com", domain_id: "019332ff-0688-7e5b-93d3-165e81b459ab", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://secure-realestatecenter.bankofamerica.com", domain_id: "01929200-61b4-7254-9421-7e97f48db312", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://secure.accountmanagement.bofa.com", domain_id: "0196d43b-3744-702b-8c13-011e2eaea4ab", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://secure.bankofamerica.com", domain_id: "a3b282c7-7ead-4ff7-b493-7f480154a61d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://secure.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://secure.fs.ml.com", domain_id: "019295ac-2ab7-7077-aac5-ce67468b4b2c", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://secure.pointofsale.bofa.com", domain_id: "0197f0ce-7fa4-762a-9d92-3e8d530d2994", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://secure.privatebank.bankofamerica.com", domain_id: "0191fc13-a4d9-76e2-b3c8-768a5ca57497", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://signaturerewards.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://socialapp-darkpod.bankofamerica.com", domain_id: "018e8648-43e7-7a8f-bcd7-0c4e770faa60", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://socialapp.bankofamerica.com", domain_id: "018e8648-43e7-7a8f-bcd7-0c4e770faa60", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://transfers.bankofamerica.com", domain_id: "72e99fdc-3ef1-452a-9b02-e35228fa4504", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://utility.bankofamerica.com", domain_id: "01929583-f6aa-7ff4-b773-0b33fed62e63", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://ux.bankofamerica.com", domain_id: "72e99fdc-3ef1-452a-9b02-e35228fa4504", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://workplaceinsights.bofa.com", domain_id: "430ffadd-ae1f-4efa-b874-5a5152ddd7fa", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://www.accesscard.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.accesscards.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.acfr.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.admin.applyonlinenow.com", domain_id: "0fedbb0b-cda5-44d3-bd08-8efc72c81e0c", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://www.admin.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.applyonlinenow.com", domain_id: "0fedbb0b-cda5-44d3-bd08-8efc72c81e0c", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://www.bankofamerica.com", domain_id: "72e99fdc-3ef1-452a-9b02-e35228fa4504", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.bankofamericasponsorships.com", domain_id: "018eed64-0516-7f7b-a0f7-58b6f076f353", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.bofaevents.com", domain_id: "fbeb20ce-eb85-4bef-abd6-a2f4451969e8", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://www.businesscards.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.card.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.cardoffer.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.cashback.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.fa.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.itadmin.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.local.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.merrill.com", domain_id: "34791c58-9c6f-49e5-8911-16fadc3a5e3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.merrilledge.com", domain_id: "3b43dd9d-6dc2-44f8-8580-3b99ce45da4b", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.merrillplus.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.mybenefits.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.mymerrill.com", domain_id: "4255fd05-0a6a-431c-bba5-e8221a5e4a97", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.nonprofitcards.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.optionnavigator.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.pbig.ml.com", domain_id: "4c4362ef-2f57-414c-b303-ae9f514fdd3c", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://www.privatebank.bankofamerica.com", domain_id: "0193acf0-f85f-7fe1-a10a-0abf77eb7a5a", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://www.pwa.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.rewards.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.rm.bofaml.com", domain_id: "0192959e-9570-7f99-843e-703626b1a764", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://www.secure.fs.ml.com", domain_id: "019295ac-2ab7-7077-aac5-ce67468b4b2c", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://www.signaturerewards.ml.com", domain_id: "96631894-4403-42bc-80fa-836d9d4816e8", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://zh-cn.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://zh-cn.mybenefits.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://zh.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" }, { domain: "https://zh.mybenefits.benefits.ml.com", domain_id: "3276a7d8-101d-4637-9c7b-43397e86ed3d", sri_hash: "sha384-WPet+17OwdIYAM+nNTYAs/s4xUc21+4S2L75Rs2k/KgQ0uOO4GNvgXezOc0/EuLq" } ]; window.vtimConfigs.oneTrust.blockedList = [ "https://olui2.fs.ml.com/MDOptionsProductCenterUI/OptionsScreener.aspx", "https://www.benefits.ml.com/Core/Frame/ContentHostV2?MenuID=1073", "https://www.benefits.ml.com/Core/Frame/ContentHostV2?MenuID=20550", "https://www.benefits.ml.com/Core/Frame/ContentHostV2?MenuID=20556", "https://www.benefits.ml.com/Core/Frame/ContentHostV2?MenuID=11075", "https://www.benefits.ml.com/Core/Frame/ContentHostV2?MenuID=11066", "https://www.benefits.ml.com/Core/Frame/ContentHostV2?MenuID=11017", "https://www.benefits.ml.com/Core/Frame/ContentHostV2?MenuID=11073", "https://www.benefits.ml.com/Core/Frame/ContentHostV2?MenuID=11015", "https://www.benefits.ml.com/Core/Frame/ContentHostV2?MenuID=11067" ]; window.vtimConfigs.oneTrust.CAADCAPages = [ { domain: "https://about.bankofamerica.com/en/making-an-impact/student-leader-eligibility-criteria", domain_id: "018ebe30-590b-77c2-b94e-870f8b265970", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://about.bankofamerica.com/en/making-an-impact/student-leaders", domain_id: "018ebe30-590b-77c2-b94e-870f8b265970", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://about.bankofamerica.com/en/making-an-impact/student-leaders-program-faq", domain_id: "018ebe30-590b-77c2-b94e-870f8b265970", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://about.bankofamerica.com/en/making-an-impact/workforce-development-programs", domain_id: "018ebe31-3081-7841-a201-377cef9f3278", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://bettermoneyhabits.bankofamerica.com/en/auto/first-car-for-teenager", domain_id: "018fcab7-fca6-7a6b-9e80-9d9100f4e892", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://bettermoneyhabits.bankofamerica.com/en/college/how-to-get-a-job-after-college", domain_id: "018fcab7-fca6-7a6b-9e80-9d9100f4e892", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://bettermoneyhabits.bankofamerica.com/en/college/terms-to-know-when-taking-out-student-loans", domain_id: "018fcab7-fca6-7a6b-9e80-9d9100f4e892", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://bettermoneyhabits.bankofamerica.com/en/financial-literacy-for-students", domain_id: "018fcab7-fca6-7a6b-9e80-9d9100f4e892", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://bettermoneyhabits.bankofamerica.com/en/personal-banking/managing-your-first-debit-card", domain_id: "018fcab7-fca6-7a6b-9e80-9d9100f4e892", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://bettermoneyhabits.bankofamerica.com/en/personal-banking/money-management-for-teens", domain_id: "018fcab7-fca6-7a6b-9e80-9d9100f4e892", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://bettermoneyhabits.bankofamerica.com/en/privacy-security/how-to-spot-common-scams-for-students", domain_id: "018fcab7-fca6-7a6b-9e80-9d9100f4e892", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://bettermoneyhabits.bankofamerica.com/en/saving-budgeting/managing-your-first-debit-card", domain_id: "018fcab7-fca6-7a6b-9e80-9d9100f4e892", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://bettermoneyhabits.bankofamerica.com/en/saving-budgeting/saving-money-as-a-teenager", domain_id: "018fcab7-fca6-7a6b-9e80-9d9100f4e892", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://bettermoneyhabits.bankofamerica.com/es/auto/first-car-for-teenager", domain_id: "018fcaba-14b8-7503-9249-36c886934445", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://bettermoneyhabits.bankofamerica.com/es/college/how-to-get-a-job-after-college", domain_id: "018fcaba-14b8-7503-9249-36c886934445", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://bettermoneyhabits.bankofamerica.com/es/college/terms-to-know-when-taking-out-student-loans", domain_id: "018fcaba-14b8-7503-9249-36c886934445", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://bettermoneyhabits.bankofamerica.com/es/financial-literacy-for-students", domain_id: "018fcaba-14b8-7503-9249-36c886934445", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://bettermoneyhabits.bankofamerica.com/es/personal-banking/managing-your-first-debit-card", domain_id: "018fcaba-14b8-7503-9249-36c886934445", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://bettermoneyhabits.bankofamerica.com/es/personal-banking/money-management-for-teens", domain_id: "018fcaba-14b8-7503-9249-36c886934445", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://bettermoneyhabits.bankofamerica.com/es/privacy-security/how-to-spot-common-scams-for-students", domain_id: "018fcaba-14b8-7503-9249-36c886934445", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://bettermoneyhabits.bankofamerica.com/es/saving-budgeting/managing-your-first-debit-card", domain_id: "018fcaba-14b8-7503-9249-36c886934445", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://bettermoneyhabits.bankofamerica.com/es/saving-budgeting/saving-money-as-a-teenager", domain_id: "018fcaba-14b8-7503-9249-36c886934445", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://info.bankofamerica.com/en/student-banking", domain_id: "019151c6-54bc-7df2-a709-739356730b74", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://info.bankofamerica.com/en/student-banking/banking-accounts", domain_id: "019151c6-54bc-7df2-a709-739356730b74", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://info.bankofamerica.com/en/student-banking/banking-basics", domain_id: "019151c6-54bc-7df2-a709-739356730b74", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://info.bankofamerica.com/en/student-banking/credit-borrowing", domain_id: "019151c6-54bc-7df2-a709-739356730b74", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://info.bankofamerica.com/en/student-banking/getting-started", domain_id: "019151c6-54bc-7df2-a709-739356730b74", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://info.bankofamerica.com/en/student-banking/products-services", domain_id: "019151c6-54bc-7df2-a709-739356730b74", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://info.bankofamerica.com/en/student-banking/products-services/banking-accounts", domain_id: "019151c6-54bc-7df2-a709-739356730b74", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://info.bankofamerica.com/en/student-banking/products-services/safebalance", domain_id: "019151c6-54bc-7df2-a709-739356730b74", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://info.bankofamerica.com/en/student-banking/spending-savings", domain_id: "019151c6-54bc-7df2-a709-739356730b74", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://info.bankofamerica.com/es/student-banking", domain_id: "019151c6-f005-7655-b932-599a0a12ccf5", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://info.bankofamerica.com/es/student-banking/banking-accounts", domain_id: "019151c6-f005-7655-b932-599a0a12ccf5", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://info.bankofamerica.com/es/student-banking/banking-basics", domain_id: "019151c6-f005-7655-b932-599a0a12ccf5", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://info.bankofamerica.com/es/student-banking/credit-borrowing", domain_id: "019151c6-f005-7655-b932-599a0a12ccf5", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://info.bankofamerica.com/es/student-banking/getting-started", domain_id: "019151c6-f005-7655-b932-599a0a12ccf5", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://info.bankofamerica.com/es/student-banking/products-services", domain_id: "019151c6-f005-7655-b932-599a0a12ccf5", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://info.bankofamerica.com/es/student-banking/products-services/banking-accounts", domain_id: "019151c6-f005-7655-b932-599a0a12ccf5", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://info.bankofamerica.com/es/student-banking/products-services/safebalance", domain_id: "019151c6-f005-7655-b932-599a0a12ccf5", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://info.bankofamerica.com/es/student-banking/spending-savings", domain_id: "019151c6-f005-7655-b932-599a0a12ccf5", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://promotions.bankofamerica.com/student-banking", domain_id: "0191290e-8c51-7fbc-ab5c-aec0bfc5f17f", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://promotions.bankofamerica.com/student-banking/bankingbasics", domain_id: "0191290e-8c51-7fbc-ab5c-aec0bfc5f17f", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://promotions.bankofamerica.com/student-banking/bankingbasics/es", domain_id: "0191290e-8c51-7fbc-ab5c-aec0bfc5f17f", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://promotions.bankofamerica.com/student-banking/credit-borrowing", domain_id: "0191290e-8c51-7fbc-ab5c-aec0bfc5f17f", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://promotions.bankofamerica.com/student-banking/credit-borrowing/es", domain_id: "0191290e-8c51-7fbc-ab5c-aec0bfc5f17f", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://promotions.bankofamerica.com/student-banking/es", domain_id: "0191290e-8c51-7fbc-ab5c-aec0bfc5f17f", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://promotions.bankofamerica.com/student-banking/products-services", domain_id: "0191290e-8c51-7fbc-ab5c-aec0bfc5f17f", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://promotions.bankofamerica.com/student-banking/products-services/es", domain_id: "0191290e-8c51-7fbc-ab5c-aec0bfc5f17f", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://promotions.bankofamerica.com/student-banking/products-services/safebalance", domain_id: "0191290e-8c51-7fbc-ab5c-aec0bfc5f17f", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://promotions.bankofamerica.com/student-banking/products-services/safebalance/es", domain_id: "0191290e-8c51-7fbc-ab5c-aec0bfc5f17f", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://promotions.bankofamerica.com/student-banking/spending-savings", domain_id: "0191290e-8c51-7fbc-ab5c-aec0bfc5f17f", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://promotions.bankofamerica.com/student-banking/spending-savings/es", domain_id: "0191290e-8c51-7fbc-ab5c-aec0bfc5f17f", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" }, { domain: "https://www.bankofamerica.com/deposits/student-banking/checking", domain_id: "6ba00e9c-679a-491c-bd2d-7c496f18a053", sri_hash: "sha384-5q6ucftJTFa2HaYbwwSoAz8eZtA8VdjlyY5qu6dvdH6ni4R0wGRb+g4Qi5+DyTfI" } ]; window.vtimConfigs.oneTrust.OneTrustPageSpecificConfig = []; } catch(e){ console.log(e) } }catch(e){console.log(e);} if(!utag_condload){try{ try{ /* * jsrsasign(all) 8.0.20 (2020-06-24) (c) 2010-2020 Kenji Urushima | kjur.github.com/jsrsasign/license */ /*! Copyright (c) 2011, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.html version: 2.9.0 */ if(YAHOO===undefined){var YAHOO={}}YAHOO.lang={extend:function(g,h,f){if(!h||!g){throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.")}var d=function(){};d.prototype=h.prototype;g.prototype=new d();g.prototype.constructor=g;g.superclass=h.prototype;if(h.prototype.constructor==Object.prototype.constructor){h.prototype.constructor=h}if(f){var b;for(b in f){g.prototype[b]=f[b]}var e=function(){},c=["toString","valueOf"];try{if(/MSIE/.test(navigator.userAgent)){e=function(j,i){for(b=0;b>>2]>>>(24-(r%4)*8))&255;q[(n+r)>>>2]|=o<<(24-((n+r)%4)*8)}}else{for(var r=0;r>>2]=p[r>>>2]}}this.sigBytes+=s;return this},clamp:function(){var o=this.words;var n=this.sigBytes;o[n>>>2]&=4294967295<<(32-(n%4)*8);o.length=e.ceil(n/4)},clone:function(){var n=j.clone.call(this);n.words=this.words.slice(0);return n},random:function(p){var o=[];for(var n=0;n>>2]>>>(24-(n%4)*8))&255;q.push((s>>>4).toString(16));q.push((s&15).toString(16))}return q.join("")},parse:function(p){var n=p.length;var q=[];for(var o=0;o>>3]|=parseInt(p.substr(o,2),16)<<(24-(o%8)*4)}return new l.init(q,n/2)}};var d=m.Latin1={stringify:function(q){var r=q.words;var p=q.sigBytes;var n=[];for(var o=0;o>>2]>>>(24-(o%4)*8))&255;n.push(String.fromCharCode(s))}return n.join("")},parse:function(p){var n=p.length;var q=[];for(var o=0;o>>2]|=(p.charCodeAt(o)&255)<<(24-(o%4)*8)}return new l.init(q,n)}};var c=m.Utf8={stringify:function(n){try{return decodeURIComponent(escape(d.stringify(n)))}catch(o){throw new Error("Malformed UTF-8 data")}},parse:function(n){return d.parse(unescape(encodeURIComponent(n)))}};var i=b.BufferedBlockAlgorithm=j.extend({reset:function(){this._data=new l.init();this._nDataBytes=0},_append:function(n){if(typeof n=="string"){n=c.parse(n)}this._data.concat(n);this._nDataBytes+=n.sigBytes},_process:function(w){var q=this._data;var x=q.words;var n=q.sigBytes;var t=this.blockSize;var v=t*4;var u=n/v;if(w){u=e.ceil(u)}else{u=e.max((u|0)-this._minBufferSize,0)}var s=u*t;var r=e.min(s*4,n);if(s){for(var p=0;p>>2]&255}};f.BlockCipher=n.extend({cfg:n.cfg.extend({mode:m,padding:h}),reset:function(){n.reset.call(this);var a=this.cfg,b=a.iv,a=a.mode;if(this._xformMode==this._ENC_XFORM_MODE)var c=a.createEncryptor;else c=a.createDecryptor,this._minBufferSize=1; this._mode=c.call(a,this,b&&b.words)},_doProcessBlock:function(a,b){this._mode.processBlock(a,b)},_doFinalize:function(){var a=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){a.pad(this._data,this.blockSize);var b=this._process(!0)}else b=this._process(!0),a.unpad(b);return b},blockSize:4});var p=f.CipherParams=k.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}}),m=(g.format={}).OpenSSL={stringify:function(a){var b=a.ciphertext;a=a.salt; return(a?l.create([1398893684,1701076831]).concat(a).concat(b):b).toString(r)},parse:function(a){a=r.parse(a);var b=a.words;if(1398893684==b[0]&&1701076831==b[1]){var c=l.create(b.slice(2,4));b.splice(0,4);a.sigBytes-=16}return p.create({ciphertext:a,salt:c})}},j=f.SerializableCipher=k.extend({cfg:k.extend({format:m}),encrypt:function(a,b,c,d){d=this.cfg.extend(d);var e=a.createEncryptor(c,d);b=e.finalize(b);e=e.cfg;return p.create({ciphertext:b,key:c,iv:e.iv,algorithm:a,mode:e.mode,padding:e.padding, blockSize:a.blockSize,formatter:d.format})},decrypt:function(a,b,c,d){d=this.cfg.extend(d);b=this._parse(b,d.format);return a.createDecryptor(c,d).finalize(b.ciphertext)},_parse:function(a,b){return"string"==typeof a?b.parse(a,this):a}}),g=(g.kdf={}).OpenSSL={execute:function(a,b,c,d){d||(d=l.random(8));a=v.create({keySize:b+c}).compute(a,d);c=l.create(a.words.slice(b),4*c);a.sigBytes=4*b;return p.create({key:a,iv:c,salt:d})}},s=f.PasswordBasedCipher=j.extend({cfg:j.cfg.extend({kdf:g}),encrypt:function(a, b,c,d){d=this.cfg.extend(d);c=d.kdf.execute(c,a.keySize,a.ivSize);d.iv=c.iv;a=j.encrypt.call(this,a,b,c.key,d);a.mixIn(c);return a},decrypt:function(a,b,c,d){d=this.cfg.extend(d);b=this._parse(b,d.format);c=d.kdf.execute(c,a.keySize,a.ivSize,b.salt);d.iv=c.iv;return j.decrypt.call(this,a,b,c.key,d)}})}(); /* CryptoJS v3.1.2 aes.js code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ (function(){for(var q=CryptoJS,x=q.lib.BlockCipher,r=q.algo,j=[],y=[],z=[],A=[],B=[],C=[],s=[],u=[],v=[],w=[],g=[],k=0;256>k;k++)g[k]=128>k?k<<1:k<<1^283;for(var n=0,l=0,k=0;256>k;k++){var f=l^l<<1^l<<2^l<<3^l<<4,f=f>>>8^f&255^99;j[n]=f;y[f]=n;var t=g[n],D=g[t],E=g[D],b=257*g[f]^16843008*f;z[n]=b<<24|b>>>8;A[n]=b<<16|b>>>16;B[n]=b<<8|b>>>24;C[n]=b;b=16843009*E^65537*D^257*t^16843008*n;s[f]=b<<24|b>>>8;u[f]=b<<16|b>>>16;v[f]=b<<8|b>>>24;w[f]=b;n?(n=t^g[g[g[E^t]]],l^=g[g[l]]):n=l=1}var F=[0,1,2,4,8, 16,32,64,128,27,54],r=r.AES=x.extend({_doReset:function(){for(var c=this._key,e=c.words,a=c.sigBytes/4,c=4*((this._nRounds=a+6)+1),b=this._keySchedule=[],h=0;h>>24]<<24|j[d>>>16&255]<<16|j[d>>>8&255]<<8|j[d&255]):(d=d<<8|d>>>24,d=j[d>>>24]<<24|j[d>>>16&255]<<16|j[d>>>8&255]<<8|j[d&255],d^=F[h/a|0]<<24);b[h]=b[h-a]^d}e=this._invKeySchedule=[];for(a=0;aa||4>=h?d:s[j[d>>>24]]^u[j[d>>>16&255]]^v[j[d>>> 8&255]]^w[j[d&255]]},encryptBlock:function(c,e){this._doCryptBlock(c,e,this._keySchedule,z,A,B,C,j)},decryptBlock:function(c,e){var a=c[e+1];c[e+1]=c[e+3];c[e+3]=a;this._doCryptBlock(c,e,this._invKeySchedule,s,u,v,w,y);a=c[e+1];c[e+1]=c[e+3];c[e+3]=a},_doCryptBlock:function(c,e,a,b,h,d,j,m){for(var n=this._nRounds,f=c[e]^a[0],g=c[e+1]^a[1],k=c[e+2]^a[2],p=c[e+3]^a[3],l=4,t=1;t>>24]^h[g>>>16&255]^d[k>>>8&255]^j[p&255]^a[l++],r=b[g>>>24]^h[k>>>16&255]^d[p>>>8&255]^j[f&255]^a[l++],s= b[k>>>24]^h[p>>>16&255]^d[f>>>8&255]^j[g&255]^a[l++],p=b[p>>>24]^h[f>>>16&255]^d[g>>>8&255]^j[k&255]^a[l++],f=q,g=r,k=s;q=(m[f>>>24]<<24|m[g>>>16&255]<<16|m[k>>>8&255]<<8|m[p&255])^a[l++];r=(m[g>>>24]<<24|m[k>>>16&255]<<16|m[p>>>8&255]<<8|m[f&255])^a[l++];s=(m[k>>>24]<<24|m[p>>>16&255]<<16|m[f>>>8&255]<<8|m[g&255])^a[l++];p=(m[p>>>24]<<24|m[f>>>16&255]<<16|m[g>>>8&255]<<8|m[k&255])^a[l++];c[e]=q;c[e+1]=r;c[e+2]=s;c[e+3]=p},keySize:8});q.AES=x._createHelper(r)})(); /* CryptoJS v3.1.2 tripledes-min.js code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ (function(){function j(b,c){var a=(this._lBlock>>>b^this._rBlock)&c;this._rBlock^=a;this._lBlock^=a<>>b^this._lBlock)&c;this._lBlock^=a;this._rBlock^=a<a;a++){var f=q[a]-1;c[a]=b[f>>>5]>>>31-f%32&1}b=this._subKeys=[];for(f=0;16>f;f++){for(var d=b[f]=[],e=r[f],a=0;24>a;a++)d[a/6|0]|=c[(p[a]-1+e)%28]<<31-a%6,d[4+(a/6|0)]|=c[28+(p[a+24]-1+e)%28]<<31-a%6;d[0]=d[0]<<1|d[0]>>>31;for(a=1;7>a;a++)d[a]>>>= 4*(a-1)+3;d[7]=d[7]<<5|d[7]>>>27}c=this._invSubKeys=[];for(a=0;16>a;a++)c[a]=b[15-a]},encryptBlock:function(b,c){this._doCryptBlock(b,c,this._subKeys)},decryptBlock:function(b,c){this._doCryptBlock(b,c,this._invSubKeys)},_doCryptBlock:function(b,c,a){this._lBlock=b[c];this._rBlock=b[c+1];j.call(this,4,252645135);j.call(this,16,65535);l.call(this,2,858993459);l.call(this,8,16711935);j.call(this,1,1431655765);for(var f=0;16>f;f++){for(var d=a[f],e=this._lBlock,h=this._rBlock,g=0,k=0;8>k;k++)g|=s[k][((h^ d[k])&t[k])>>>0];this._lBlock=h;this._rBlock=e^g}a=this._lBlock;this._lBlock=this._rBlock;this._rBlock=a;j.call(this,1,1431655765);l.call(this,8,16711935);l.call(this,2,858993459);j.call(this,16,65535);j.call(this,4,252645135);b[c]=this._lBlock;b[c+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});h.DES=e._createHelper(m);g=g.TripleDES=e.extend({_doReset:function(){var b=this._key.words;this._des1=m.createEncryptor(n.create(b.slice(0,2)));this._des2=m.createEncryptor(n.create(b.slice(2,4)));this._des3= m.createEncryptor(n.create(b.slice(4,6)))},encryptBlock:function(b,c){this._des1.encryptBlock(b,c);this._des2.decryptBlock(b,c);this._des3.encryptBlock(b,c)},decryptBlock:function(b,c){this._des3.decryptBlock(b,c);this._des2.encryptBlock(b,c);this._des1.decryptBlock(b,c)},keySize:6,ivSize:2,blockSize:2});h.TripleDES=e._createHelper(g)})(); /* CryptoJS v3.1.2 enc-base64.js code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ (function(){var h=CryptoJS,j=h.lib.WordArray;h.enc.Base64={stringify:function(b){var e=b.words,f=b.sigBytes,c=this._map;b.clamp();b=[];for(var a=0;a>>2]>>>24-8*(a%4)&255)<<16|(e[a+1>>>2]>>>24-8*((a+1)%4)&255)<<8|e[a+2>>>2]>>>24-8*((a+2)%4)&255,g=0;4>g&&a+0.75*g>>6*(3-g)&63));if(e=c.charAt(64))for(;b.length%4;)b.push(e);return b.join("")},parse:function(b){var e=b.length,f=this._map,c=f.charAt(64);c&&(c=b.indexOf(c),-1!=c&&(e=c));for(var c=[],a=0,d=0;d< e;d++)if(d%4){var g=f.indexOf(b.charAt(d-1))<<2*(d%4),h=f.indexOf(b.charAt(d))>>>6-2*(d%4);c[a>>>2]|=(g|h)<<24-8*(a%4);a++}return j.create(c,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})(); /* CryptoJS v3.1.2 md5.js code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ (function(E){function h(a,f,g,j,p,h,k){a=a+(f&g|~f&j)+p+k;return(a<>>32-h)+f}function k(a,f,g,j,p,h,k){a=a+(f&j|g&~j)+p+k;return(a<>>32-h)+f}function l(a,f,g,j,h,k,l){a=a+(f^g^j)+h+l;return(a<>>32-k)+f}function n(a,f,g,j,h,k,l){a=a+(g^(f|~j))+h+l;return(a<>>32-k)+f}for(var r=CryptoJS,q=r.lib,F=q.WordArray,s=q.Hasher,q=r.algo,a=[],t=0;64>t;t++)a[t]=4294967296*E.abs(E.sin(t+1))|0;q=q.MD5=s.extend({_doReset:function(){this._hash=new F.init([1732584193,4023233417,2562383102,271733878])}, _doProcessBlock:function(m,f){for(var g=0;16>g;g++){var j=f+g,p=m[j];m[j]=(p<<8|p>>>24)&16711935|(p<<24|p>>>8)&4278255360}var g=this._hash.words,j=m[f+0],p=m[f+1],q=m[f+2],r=m[f+3],s=m[f+4],t=m[f+5],u=m[f+6],v=m[f+7],w=m[f+8],x=m[f+9],y=m[f+10],z=m[f+11],A=m[f+12],B=m[f+13],C=m[f+14],D=m[f+15],b=g[0],c=g[1],d=g[2],e=g[3],b=h(b,c,d,e,j,7,a[0]),e=h(e,b,c,d,p,12,a[1]),d=h(d,e,b,c,q,17,a[2]),c=h(c,d,e,b,r,22,a[3]),b=h(b,c,d,e,s,7,a[4]),e=h(e,b,c,d,t,12,a[5]),d=h(d,e,b,c,u,17,a[6]),c=h(c,d,e,b,v,22,a[7]), b=h(b,c,d,e,w,7,a[8]),e=h(e,b,c,d,x,12,a[9]),d=h(d,e,b,c,y,17,a[10]),c=h(c,d,e,b,z,22,a[11]),b=h(b,c,d,e,A,7,a[12]),e=h(e,b,c,d,B,12,a[13]),d=h(d,e,b,c,C,17,a[14]),c=h(c,d,e,b,D,22,a[15]),b=k(b,c,d,e,p,5,a[16]),e=k(e,b,c,d,u,9,a[17]),d=k(d,e,b,c,z,14,a[18]),c=k(c,d,e,b,j,20,a[19]),b=k(b,c,d,e,t,5,a[20]),e=k(e,b,c,d,y,9,a[21]),d=k(d,e,b,c,D,14,a[22]),c=k(c,d,e,b,s,20,a[23]),b=k(b,c,d,e,x,5,a[24]),e=k(e,b,c,d,C,9,a[25]),d=k(d,e,b,c,r,14,a[26]),c=k(c,d,e,b,w,20,a[27]),b=k(b,c,d,e,B,5,a[28]),e=k(e,b, c,d,q,9,a[29]),d=k(d,e,b,c,v,14,a[30]),c=k(c,d,e,b,A,20,a[31]),b=l(b,c,d,e,t,4,a[32]),e=l(e,b,c,d,w,11,a[33]),d=l(d,e,b,c,z,16,a[34]),c=l(c,d,e,b,C,23,a[35]),b=l(b,c,d,e,p,4,a[36]),e=l(e,b,c,d,s,11,a[37]),d=l(d,e,b,c,v,16,a[38]),c=l(c,d,e,b,y,23,a[39]),b=l(b,c,d,e,B,4,a[40]),e=l(e,b,c,d,j,11,a[41]),d=l(d,e,b,c,r,16,a[42]),c=l(c,d,e,b,u,23,a[43]),b=l(b,c,d,e,x,4,a[44]),e=l(e,b,c,d,A,11,a[45]),d=l(d,e,b,c,D,16,a[46]),c=l(c,d,e,b,q,23,a[47]),b=n(b,c,d,e,j,6,a[48]),e=n(e,b,c,d,v,10,a[49]),d=n(d,e,b,c, C,15,a[50]),c=n(c,d,e,b,t,21,a[51]),b=n(b,c,d,e,A,6,a[52]),e=n(e,b,c,d,r,10,a[53]),d=n(d,e,b,c,y,15,a[54]),c=n(c,d,e,b,p,21,a[55]),b=n(b,c,d,e,w,6,a[56]),e=n(e,b,c,d,D,10,a[57]),d=n(d,e,b,c,u,15,a[58]),c=n(c,d,e,b,B,21,a[59]),b=n(b,c,d,e,s,6,a[60]),e=n(e,b,c,d,z,10,a[61]),d=n(d,e,b,c,q,15,a[62]),c=n(c,d,e,b,x,21,a[63]);g[0]=g[0]+b|0;g[1]=g[1]+c|0;g[2]=g[2]+d|0;g[3]=g[3]+e|0},_doFinalize:function(){var a=this._data,f=a.words,g=8*this._nDataBytes,j=8*a.sigBytes;f[j>>>5]|=128<<24-j%32;var h=E.floor(g/ 4294967296);f[(j+64>>>9<<4)+15]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360;f[(j+64>>>9<<4)+14]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360;a.sigBytes=4*(f.length+1);this._process();a=this._hash;f=a.words;for(g=0;4>g;g++)j=f[g],f[g]=(j<<8|j>>>24)&16711935|(j<<24|j>>>8)&4278255360;return a},clone:function(){var a=s.clone.call(this);a._hash=this._hash.clone();return a}});r.MD5=s._createHelper(q);r.HmacMD5=s._createHmacHelper(q)})(Math); /* CryptoJS v3.1.2 sha1-min.js code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ (function(){var k=CryptoJS,b=k.lib,m=b.WordArray,l=b.Hasher,d=[],b=k.algo.SHA1=l.extend({_doReset:function(){this._hash=new m.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(n,p){for(var a=this._hash.words,e=a[0],f=a[1],h=a[2],j=a[3],b=a[4],c=0;80>c;c++){if(16>c)d[c]=n[p+c]|0;else{var g=d[c-3]^d[c-8]^d[c-14]^d[c-16];d[c]=g<<1|g>>>31}g=(e<<5|e>>>27)+b+d[c];g=20>c?g+((f&h|~f&j)+1518500249):40>c?g+((f^h^j)+1859775393):60>c?g+((f&h|f&j|h&j)-1894007588):g+((f^h^ j)-899497514);b=j;j=h;h=f<<30|f>>>2;f=e;e=g}a[0]=a[0]+e|0;a[1]=a[1]+f|0;a[2]=a[2]+h|0;a[3]=a[3]+j|0;a[4]=a[4]+b|0},_doFinalize:function(){var b=this._data,d=b.words,a=8*this._nDataBytes,e=8*b.sigBytes;d[e>>>5]|=128<<24-e%32;d[(e+64>>>9<<4)+14]=Math.floor(a/4294967296);d[(e+64>>>9<<4)+15]=a;b.sigBytes=4*d.length;this._process();return this._hash},clone:function(){var b=l.clone.call(this);b._hash=this._hash.clone();return b}});k.SHA1=l._createHelper(b);k.HmacSHA1=l._createHmacHelper(b)})(); /* CryptoJS v3.1.2 sha256-min.js code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ (function(k){for(var g=CryptoJS,h=g.lib,v=h.WordArray,j=h.Hasher,h=g.algo,s=[],t=[],u=function(q){return 4294967296*(q-(q|0))|0},l=2,b=0;64>b;){var d;a:{d=l;for(var w=k.sqrt(d),r=2;r<=w;r++)if(!(d%r)){d=!1;break a}d=!0}d&&(8>b&&(s[b]=u(k.pow(l,0.5))),t[b]=u(k.pow(l,1/3)),b++);l++}var n=[],h=h.SHA256=j.extend({_doReset:function(){this._hash=new v.init(s.slice(0))},_doProcessBlock:function(q,h){for(var a=this._hash.words,c=a[0],d=a[1],b=a[2],k=a[3],f=a[4],g=a[5],j=a[6],l=a[7],e=0;64>e;e++){if(16>e)n[e]= q[h+e]|0;else{var m=n[e-15],p=n[e-2];n[e]=((m<<25|m>>>7)^(m<<14|m>>>18)^m>>>3)+n[e-7]+((p<<15|p>>>17)^(p<<13|p>>>19)^p>>>10)+n[e-16]}m=l+((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+(f&g^~f&j)+t[e]+n[e];p=((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+(c&d^c&b^d&b);l=j;j=g;g=f;f=k+m|0;k=b;b=d;d=c;c=m+p|0}a[0]=a[0]+c|0;a[1]=a[1]+d|0;a[2]=a[2]+b|0;a[3]=a[3]+k|0;a[4]=a[4]+f|0;a[5]=a[5]+g|0;a[6]=a[6]+j|0;a[7]=a[7]+l|0},_doFinalize:function(){var d=this._data,b=d.words,a=8*this._nDataBytes,c=8*d.sigBytes; b[c>>>5]|=128<<24-c%32;b[(c+64>>>9<<4)+14]=k.floor(a/4294967296);b[(c+64>>>9<<4)+15]=a;d.sigBytes=4*b.length;this._process();return this._hash},clone:function(){var b=j.clone.call(this);b._hash=this._hash.clone();return b}});g.SHA256=j._createHelper(h);g.HmacSHA256=j._createHmacHelper(h)})(Math); /* CryptoJS v3.1.2 sha224-min.js code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ (function(){var b=CryptoJS,d=b.lib.WordArray,a=b.algo,c=a.SHA256,a=a.SHA224=c.extend({_doReset:function(){this._hash=new d.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var a=c._doFinalize.call(this);a.sigBytes-=4;return a}});b.SHA224=c._createHelper(a);b.HmacSHA224=c._createHmacHelper(a)})(); /* CryptoJS v3.1.2 sha512-min.js code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ (function(){function a(){return d.create.apply(d,arguments)}for(var n=CryptoJS,r=n.lib.Hasher,e=n.x64,d=e.Word,T=e.WordArray,e=n.algo,ea=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317), a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291, 2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899), a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470, 3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],v=[],w=0;80>w;w++)v[w]=a();e=e.SHA512=r.extend({_doReset:function(){this._hash=new T.init([new d.init(1779033703,4089235720),new d.init(3144134277,2227873595),new d.init(1013904242,4271175723),new d.init(2773480762,1595750129),new d.init(1359893119,2917565137),new d.init(2600822924,725511199),new d.init(528734635,4215389547),new d.init(1541459225,327033209)])},_doProcessBlock:function(a,d){for(var f=this._hash.words, F=f[0],e=f[1],n=f[2],r=f[3],G=f[4],H=f[5],I=f[6],f=f[7],w=F.high,J=F.low,X=e.high,K=e.low,Y=n.high,L=n.low,Z=r.high,M=r.low,$=G.high,N=G.low,aa=H.high,O=H.low,ba=I.high,P=I.low,ca=f.high,Q=f.low,k=w,g=J,z=X,x=K,A=Y,y=L,U=Z,B=M,l=$,h=N,R=aa,C=O,S=ba,D=P,V=ca,E=Q,m=0;80>m;m++){var s=v[m];if(16>m)var j=s.high=a[d+2*m]|0,b=s.low=a[d+2*m+1]|0;else{var j=v[m-15],b=j.high,p=j.low,j=(b>>>1|p<<31)^(b>>>8|p<<24)^b>>>7,p=(p>>>1|b<<31)^(p>>>8|b<<24)^(p>>>7|b<<25),u=v[m-2],b=u.high,c=u.low,u=(b>>>19|c<<13)^(b<< 3|c>>>29)^b>>>6,c=(c>>>19|b<<13)^(c<<3|b>>>29)^(c>>>6|b<<26),b=v[m-7],W=b.high,t=v[m-16],q=t.high,t=t.low,b=p+b.low,j=j+W+(b>>>0

>>0?1:0),b=b+c,j=j+u+(b>>>0>>0?1:0),b=b+t,j=j+q+(b>>>0>>0?1:0);s.high=j;s.low=b}var W=l&R^~l&S,t=h&C^~h&D,s=k&z^k&A^z&A,T=g&x^g&y^x&y,p=(k>>>28|g<<4)^(k<<30|g>>>2)^(k<<25|g>>>7),u=(g>>>28|k<<4)^(g<<30|k>>>2)^(g<<25|k>>>7),c=ea[m],fa=c.high,da=c.low,c=E+((h>>>14|l<<18)^(h>>>18|l<<14)^(h<<23|l>>>9)),q=V+((l>>>14|h<<18)^(l>>>18|h<<14)^(l<<23|h>>>9))+(c>>>0>>0?1: 0),c=c+t,q=q+W+(c>>>0>>0?1:0),c=c+da,q=q+fa+(c>>>0>>0?1:0),c=c+b,q=q+j+(c>>>0>>0?1:0),b=u+T,s=p+s+(b>>>0>>0?1:0),V=S,E=D,S=R,D=C,R=l,C=h,h=B+c|0,l=U+q+(h>>>0>>0?1:0)|0,U=A,B=y,A=z,y=x,z=k,x=g,g=c+b|0,k=q+s+(g>>>0>>0?1:0)|0}J=F.low=J+g;F.high=w+k+(J>>>0>>0?1:0);K=e.low=K+x;e.high=X+z+(K>>>0>>0?1:0);L=n.low=L+y;n.high=Y+A+(L>>>0>>0?1:0);M=r.low=M+B;r.high=Z+U+(M>>>0>>0?1:0);N=G.low=N+h;G.high=$+l+(N>>>0>>0?1:0);O=H.low=O+C;H.high=aa+R+(O>>>0>>0?1:0);P=I.low=P+D; I.high=ba+S+(P>>>0>>0?1:0);Q=f.low=Q+E;f.high=ca+V+(Q>>>0>>0?1:0)},_doFinalize:function(){var a=this._data,d=a.words,f=8*this._nDataBytes,e=8*a.sigBytes;d[e>>>5]|=128<<24-e%32;d[(e+128>>>10<<5)+30]=Math.floor(f/4294967296);d[(e+128>>>10<<5)+31]=f;a.sigBytes=4*d.length;this._process();return this._hash.toX32()},clone:function(){var a=r.clone.call(this);a._hash=this._hash.clone();return a},blockSize:32});n.SHA512=r._createHelper(e);n.HmacSHA512=r._createHmacHelper(e)})(); /* CryptoJS v3.1.2 sha384-min.js code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ (function(){var c=CryptoJS,a=c.x64,b=a.Word,e=a.WordArray,a=c.algo,d=a.SHA512,a=a.SHA384=d.extend({_doReset:function(){this._hash=new e.init([new b.init(3418070365,3238371032),new b.init(1654270250,914150663),new b.init(2438529370,812702999),new b.init(355462360,4144912697),new b.init(1731405415,4290775857),new b.init(2394180231,1750603025),new b.init(3675008525,1694076839),new b.init(1203062813,3204075428)])},_doFinalize:function(){var a=d._doFinalize.call(this);a.sigBytes-=16;return a}});c.SHA384= d._createHelper(a);c.HmacSHA384=d._createHmacHelper(a)})(); /* CryptoJS v3.1.2 ripemd160-min.js code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ /* (c) 2012 by Cedric Mesnil. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ (function(){var q=CryptoJS,d=q.lib,n=d.WordArray,p=d.Hasher,d=q.algo,x=n.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),y=n.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),z=n.create([11,14,15,12, 5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),A=n.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),B=n.create([0,1518500249,1859775393,2400959708,2840853838]),C=n.create([1352829926,1548603684,1836072691, 2053994217,0]),d=d.RIPEMD160=p.extend({_doReset:function(){this._hash=n.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,v){for(var b=0;16>b;b++){var c=v+b,f=e[c];e[c]=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360}var c=this._hash.words,f=B.words,d=C.words,n=x.words,q=y.words,p=z.words,w=A.words,t,g,h,j,r,u,k,l,m,s;u=t=c[0];k=g=c[1];l=h=c[2];m=j=c[3];s=r=c[4];for(var a,b=0;80>b;b+=1)a=t+e[v+n[b]]|0,a=16>b?a+((g^h^j)+f[0]):32>b?a+((g&h|~g&j)+f[1]):48>b? a+(((g|~h)^j)+f[2]):64>b?a+((g&j|h&~j)+f[3]):a+((g^(h|~j))+f[4]),a|=0,a=a<>>32-p[b],a=a+r|0,t=r,r=j,j=h<<10|h>>>22,h=g,g=a,a=u+e[v+q[b]]|0,a=16>b?a+((k^(l|~m))+d[0]):32>b?a+((k&m|l&~m)+d[1]):48>b?a+(((k|~l)^m)+d[2]):64>b?a+((k&l|~k&m)+d[3]):a+((k^l^m)+d[4]),a|=0,a=a<>>32-w[b],a=a+s|0,u=s,s=m,m=l<<10|l>>>22,l=k,k=a;a=c[1]+h+m|0;c[1]=c[2]+j+s|0;c[2]=c[3]+r+u|0;c[3]=c[4]+t+k|0;c[4]=c[0]+g+l|0;c[0]=a},_doFinalize:function(){var e=this._data,d=e.words,b=8*this._nDataBytes,c=8*e.sigBytes; d[c>>>5]|=128<<24-c%32;d[(c+64>>>9<<4)+14]=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360;e.sigBytes=4*(d.length+1);this._process();e=this._hash;d=e.words;for(b=0;5>b;b++)c=d[b],d[b]=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360;return e},clone:function(){var d=p.clone.call(this);d._hash=this._hash.clone();return d}});q.RIPEMD160=p._createHelper(d);q.HmacRIPEMD160=p._createHmacHelper(d)})(Math); /* CryptoJS v3.1.2 hmac.js code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ (function(){var c=CryptoJS,k=c.enc.Utf8;c.algo.HMAC=c.lib.Base.extend({init:function(a,b){a=this._hasher=new a.init;"string"==typeof b&&(b=k.parse(b));var c=a.blockSize,e=4*c;b.sigBytes>e&&(b=a.finalize(b));b.clamp();for(var f=this._oKey=b.clone(),g=this._iKey=b.clone(),h=f.words,j=g.words,d=0;d>6)+b64map.charAt(e&63)}if(b+1==d.length){e=parseInt(d.substring(b,b+1),16);a+=b64map.charAt(e<<2)}else{if(b+2==d.length){e=parseInt(d.substring(b,b+2),16);a+=b64map.charAt(e>>2)+b64map.charAt((e&3)<<4)}}if(b64pad){while((a.length&3)>0){a+=b64pad}}return a}function b64tohex(f){var d="";var e;var b=0;var c;var a;for(e=0;e>2);c=a&3;b=1}else{if(b==1){d+=int2char((c<<2)|(a>>4));c=a&15;b=2}else{if(b==2){d+=int2char(c);d+=int2char(a>>2);c=a&3;b=3}else{d+=int2char((c<<2)|(a>>4));d+=int2char(a&15);b=0}}}}if(b==1){d+=int2char(c<<2)}return d}function b64toBA(e){var d=b64tohex(e);var c;var b=new Array();for(c=0;2*c=0){var d=a*this[f++]+b[e]+h;h=Math.floor(d/67108864);b[e++]=d&67108863}return h}function am2(f,q,r,e,o,a){var k=q&32767,p=q>>15;while(--a>=0){var d=this[f]&32767;var g=this[f++]>>15;var b=p*d+g*k;d=k*d+((b&32767)<<15)+r[e]+(o&1073741823);o=(d>>>30)+(b>>>15)+p*g+(o>>>30);r[e++]=d&1073741823}return o}function am3(f,q,r,e,o,a){var k=q&16383,p=q>>14;while(--a>=0){var d=this[f]&16383;var g=this[f++]>>14;var b=p*d+g*k;d=k*d+((b&16383)<<14)+r[e]+o;o=(d>>28)+(b>>14)+p*g;r[e++]=d&268435455}return o}if(j_lm&&(navigator.appName=="Microsoft Internet Explorer")){BigInteger.prototype.am=am2;dbits=30}else{if(j_lm&&(navigator.appName!="Netscape")){BigInteger.prototype.am=am1;dbits=26}else{BigInteger.prototype.am=am3;dbits=28}}BigInteger.prototype.DB=dbits;BigInteger.prototype.DM=((1<=0;--a){b[a]=this[a]}b.t=this.t;b.s=this.s}function bnpFromInt(a){this.t=1;this.s=(a<0)?-1:0;if(a>0){this[0]=a}else{if(a<-1){this[0]=a+this.DV}else{this.t=0}}}function nbv(a){var b=nbi();b.fromInt(a);return b}function bnpFromString(h,c){var e;if(c==16){e=4}else{if(c==8){e=3}else{if(c==256){e=8}else{if(c==2){e=1}else{if(c==32){e=5}else{if(c==4){e=2}else{this.fromRadix(h,c);return}}}}}}this.t=0;this.s=0;var g=h.length,d=false,f=0;while(--g>=0){var a=(e==8)?h[g]&255:intAt(h,g);if(a<0){if(h.charAt(g)=="-"){d=true}continue}d=false;if(f==0){this[this.t++]=a}else{if(f+e>this.DB){this[this.t-1]|=(a&((1<<(this.DB-f))-1))<>(this.DB-f))}else{this[this.t-1]|=a<=this.DB){f-=this.DB}}if(e==8&&(h[0]&128)!=0){this.s=-1;if(f>0){this[this.t-1]|=((1<<(this.DB-f))-1)<0&&this[this.t-1]==a){--this.t}}function bnToString(c){if(this.s<0){return"-"+this.negate().toString(c)}var e;if(c==16){e=4}else{if(c==8){e=3}else{if(c==2){e=1}else{if(c==32){e=5}else{if(c==4){e=2}else{return this.toRadix(c)}}}}}var g=(1<0){if(j>j)>0){a=true;h=int2char(l)}while(f>=0){if(j>(j+=this.DB-e)}else{l=(this[f]>>(j-=e))&g;if(j<=0){j+=this.DB;--f}}if(l>0){a=true}if(a){h+=int2char(l)}}}return a?h:"0"}function bnNegate(){var a=nbi();BigInteger.ZERO.subTo(this,a);return a}function bnAbs(){return(this.s<0)?this.negate():this}function bnCompareTo(b){var d=this.s-b.s;if(d!=0){return d}var c=this.t;d=c-b.t;if(d!=0){return(this.s<0)?-d:d}while(--c>=0){if((d=this[c]-b[c])!=0){return d}}return 0}function nbits(a){var c=1,b;if((b=a>>>16)!=0){a=b;c+=16}if((b=a>>8)!=0){a=b;c+=8}if((b=a>>4)!=0){a=b;c+=4}if((b=a>>2)!=0){a=b;c+=2}if((b=a>>1)!=0){a=b;c+=1}return c}function bnBitLength(){if(this.t<=0){return 0}return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM))}function bnpDLShiftTo(c,b){var a;for(a=this.t-1;a>=0;--a){b[a+c]=this[a]}for(a=c-1;a>=0;--a){b[a]=0}b.t=this.t+c;b.s=this.s}function bnpDRShiftTo(c,b){for(var a=c;a=0;--d){e[d+f+1]=(this[d]>>a)|h;h=(this[d]&g)<=0;--d){e[d]=0}e[f]=h;e.t=this.t+f+1;e.s=this.s;e.clamp()}function bnpRShiftTo(g,d){d.s=this.s;var e=Math.floor(g/this.DB);if(e>=this.t){d.t=0;return}var b=g%this.DB;var a=this.DB-b;var f=(1<>b;for(var c=e+1;c>b}if(b>0){d[this.t-e-1]|=(this.s&f)<>=this.DB}if(d.t>=this.DB}g+=this.s}else{g+=this.s;while(e>=this.DB}g-=d.s}f.s=(g<0)?-1:0;if(g<-1){f[e++]=this.DV+g}else{if(g>0){f[e++]=g}}f.t=e;f.clamp()}function bnpMultiplyTo(c,e){var b=this.abs(),f=c.abs();var d=b.t;e.t=d+f.t;while(--d>=0){e[d]=0}for(d=0;d=0){d[b]=0}for(b=0;b=a.DV){d[b+a.t]-=a.DV;d[b+a.t+1]=1}}if(d.t>0){d[d.t-1]+=a.am(b,a[b],d,2*b,0,1)}d.s=0;d.clamp()}function bnpDivRemTo(n,h,g){var w=n.abs();if(w.t<=0){return}var k=this.abs();if(k.t0){w.lShiftTo(v,d);k.lShiftTo(v,g)}else{w.copyTo(d);k.copyTo(g)}var p=d.t;var b=d[p-1];if(b==0){return}var o=b*(1<1)?d[p-2]>>this.F2:0);var A=this.FV/o,z=(1<=0){g[g.t++]=1;g.subTo(f,g)}BigInteger.ONE.dlShiftTo(p,f);f.subTo(d,d);while(d.t=0){var c=(g[--u]==b)?this.DM:Math.floor(g[u]*A+(g[u-1]+x)*z);if((g[u]+=d.am(0,c,g,s,0,p))0){g.rShiftTo(v,g)}if(a<0){BigInteger.ZERO.subTo(g,g)}}function bnMod(b){var c=nbi();this.abs().divRemTo(b,null,c);if(this.s<0&&c.compareTo(BigInteger.ZERO)>0){b.subTo(c,c)}return c}function Classic(a){this.m=a}function cConvert(a){if(a.s<0||a.compareTo(this.m)>=0){return a.mod(this.m)}else{return a}}function cRevert(a){return a}function cReduce(a){a.divRemTo(this.m,null,a)}function cMulTo(a,c,b){a.multiplyTo(c,b);this.reduce(b)}function cSqrTo(a,b){a.squareTo(b);this.reduce(b)}Classic.prototype.convert=cConvert;Classic.prototype.revert=cRevert;Classic.prototype.reduce=cReduce;Classic.prototype.mulTo=cMulTo;Classic.prototype.sqrTo=cSqrTo;function bnpInvDigit(){if(this.t<1){return 0}var a=this[0];if((a&1)==0){return 0}var b=a&3;b=(b*(2-(a&15)*b))&15;b=(b*(2-(a&255)*b))&255;b=(b*(2-(((a&65535)*b)&65535)))&65535;b=(b*(2-a*b%this.DV))%this.DV;return(b>0)?this.DV-b:-b}function Montgomery(a){this.m=a;this.mp=a.invDigit();this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<<(a.DB-15))-1;this.mt2=2*a.t}function montConvert(a){var b=nbi();a.abs().dlShiftTo(this.m.t,b);b.divRemTo(this.m,null,b);if(a.s<0&&b.compareTo(BigInteger.ZERO)>0){this.m.subTo(b,b)}return b}function montRevert(a){var b=nbi();a.copyTo(b);this.reduce(b);return b}function montReduce(a){while(a.t<=this.mt2){a[a.t++]=0}for(var c=0;c>15)*this.mpl)&this.um)<<15))&a.DM;b=c+this.m.t;a[b]+=this.m.am(0,d,a,c,0,this.m.t);while(a[b]>=a.DV){a[b]-=a.DV;a[++b]++}}a.clamp();a.drShiftTo(this.m.t,a);if(a.compareTo(this.m)>=0){a.subTo(this.m,a)}}function montSqrTo(a,b){a.squareTo(b);this.reduce(b)}function montMulTo(a,c,b){a.multiplyTo(c,b);this.reduce(b)}Montgomery.prototype.convert=montConvert;Montgomery.prototype.revert=montRevert;Montgomery.prototype.reduce=montReduce;Montgomery.prototype.mulTo=montMulTo;Montgomery.prototype.sqrTo=montSqrTo;function bnpIsEven(){return((this.t>0)?(this[0]&1):this.s)==0}function bnpExp(h,j){if(h>4294967295||h<1){return BigInteger.ONE}var f=nbi(),a=nbi(),d=j.convert(this),c=nbits(h)-1;d.copyTo(f);while(--c>=0){j.sqrTo(f,a);if((h&(1<0){j.mulTo(a,d,f)}else{var b=f;f=a;a=b}}return j.revert(f)}function bnModPowInt(b,a){var c;if(b<256||a.isEven()){c=new Classic(a)}else{c=new Montgomery(a)}return this.exp(b,c)}BigInteger.prototype.copyTo=bnpCopyTo;BigInteger.prototype.fromInt=bnpFromInt;BigInteger.prototype.fromString=bnpFromString;BigInteger.prototype.clamp=bnpClamp;BigInteger.prototype.dlShiftTo=bnpDLShiftTo;BigInteger.prototype.drShiftTo=bnpDRShiftTo;BigInteger.prototype.lShiftTo=bnpLShiftTo;BigInteger.prototype.rShiftTo=bnpRShiftTo;BigInteger.prototype.subTo=bnpSubTo;BigInteger.prototype.multiplyTo=bnpMultiplyTo;BigInteger.prototype.squareTo=bnpSquareTo;BigInteger.prototype.divRemTo=bnpDivRemTo;BigInteger.prototype.invDigit=bnpInvDigit;BigInteger.prototype.isEven=bnpIsEven;BigInteger.prototype.exp=bnpExp;BigInteger.prototype.toString=bnToString;BigInteger.prototype.negate=bnNegate;BigInteger.prototype.abs=bnAbs;BigInteger.prototype.compareTo=bnCompareTo;BigInteger.prototype.bitLength=bnBitLength;BigInteger.prototype.mod=bnMod;BigInteger.prototype.modPowInt=bnModPowInt;BigInteger.ZERO=nbv(0);BigInteger.ONE=nbv(1); /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */ function bnClone(){var a=nbi();this.copyTo(a);return a}function bnIntValue(){if(this.s<0){if(this.t==1){return this[0]-this.DV}else{if(this.t==0){return -1}}}else{if(this.t==1){return this[0]}else{if(this.t==0){return 0}}}return((this[1]&((1<<(32-this.DB))-1))<>24}function bnShortValue(){return(this.t==0)?this.s:(this[0]<<16)>>16}function bnpChunkSize(a){return Math.floor(Math.LN2*this.DB/Math.log(a))}function bnSigNum(){if(this.s<0){return -1}else{if(this.t<=0||(this.t==1&&this[0]<=0)){return 0}else{return 1}}}function bnpToRadix(c){if(c==null){c=10}if(this.signum()==0||c<2||c>36){return"0"}var f=this.chunkSize(c);var e=Math.pow(c,f);var i=nbv(e),j=nbi(),h=nbi(),g="";this.divRemTo(i,j,h);while(j.signum()>0){g=(e+h.intValue()).toString(c).substr(1)+g;j.divRemTo(i,j,h)}return h.intValue().toString(c)+g}function bnpFromRadix(m,h){this.fromInt(0);if(h==null){h=10}var f=this.chunkSize(h);var g=Math.pow(h,f),e=false,a=0,l=0;for(var c=0;c=f){this.dMultiply(g);this.dAddOffset(l,0);a=0;l=0}}if(a>0){this.dMultiply(Math.pow(h,a));this.dAddOffset(l,0)}if(e){BigInteger.ZERO.subTo(this,this)}}function bnpFromNumber(f,e,h){if("number"==typeof e){if(f<2){this.fromInt(1)}else{this.fromNumber(f,h);if(!this.testBit(f-1)){this.bitwiseTo(BigInteger.ONE.shiftLeft(f-1),op_or,this)}if(this.isEven()){this.dAddOffset(1,0)}while(!this.isProbablePrime(e)){this.dAddOffset(2,0);if(this.bitLength()>f){this.subTo(BigInteger.ONE.shiftLeft(f-1),this)}}}}else{var d=new Array(),g=f&7;d.length=(f>>3)+1;e.nextBytes(d);if(g>0){d[0]&=((1<0){if(e>e)!=(this.s&this.DM)>>e){c[a++]=f|(this.s<<(this.DB-e))}while(b>=0){if(e<8){f=(this[b]&((1<>(e+=this.DB-8)}else{f=(this[b]>>(e-=8))&255;if(e<=0){e+=this.DB;--b}}if((f&128)!=0){f|=-256}if(a==0&&(this.s&128)!=(f&128)){++a}if(a>0||f!=this.s){c[a++]=f}}}return c}function bnEquals(b){return(this.compareTo(b)==0)}function bnMin(b){return(this.compareTo(b)<0)?this:b}function bnMax(b){return(this.compareTo(b)>0)?this:b}function bnpBitwiseTo(c,h,e){var d,g,b=Math.min(c.t,this.t);for(d=0;d>=16;b+=16}if((a&255)==0){a>>=8;b+=8}if((a&15)==0){a>>=4;b+=4}if((a&3)==0){a>>=2;b+=2}if((a&1)==0){++b}return b}function bnGetLowestSetBit(){for(var a=0;a=this.t){return(this.s!=0)}return((this[a]&(1<<(b%this.DB)))!=0)}function bnpChangeBit(c,b){var a=BigInteger.ONE.shiftLeft(c);this.bitwiseTo(a,b,a);return a}function bnSetBit(a){return this.changeBit(a,op_or)}function bnClearBit(a){return this.changeBit(a,op_andnot)}function bnFlipBit(a){return this.changeBit(a,op_xor)}function bnpAddTo(d,f){var e=0,g=0,b=Math.min(d.t,this.t);while(e>=this.DB}if(d.t>=this.DB}g+=this.s}else{g+=this.s;while(e>=this.DB}g+=d.s}f.s=(g<0)?-1:0;if(g>0){f[e++]=g}else{if(g<-1){f[e++]=this.DV+g}}f.t=e;f.clamp()}function bnAdd(b){var c=nbi();this.addTo(b,c);return c}function bnSubtract(b){var c=nbi();this.subTo(b,c);return c}function bnMultiply(b){var c=nbi();this.multiplyTo(b,c);return c}function bnSquare(){var a=nbi();this.squareTo(a);return a}function bnDivide(b){var c=nbi();this.divRemTo(b,c,null);return c}function bnRemainder(b){var c=nbi();this.divRemTo(b,null,c);return c}function bnDivideAndRemainder(b){var d=nbi(),c=nbi();this.divRemTo(b,d,c);return new Array(d,c)}function bnpDMultiply(a){this[this.t]=this.am(0,a-1,this,0,0,this.t);++this.t;this.clamp()}function bnpDAddOffset(b,a){if(b==0){return}while(this.t<=a){this[this.t++]=0}this[a]+=b;while(this[a]>=this.DV){this[a]-=this.DV;if(++a>=this.t){this[this.t++]=0}++this[a]}}function NullExp(){}function nNop(a){return a}function nMulTo(a,c,b){a.multiplyTo(c,b)}function nSqrTo(a,b){a.squareTo(b)}NullExp.prototype.convert=nNop;NullExp.prototype.revert=nNop;NullExp.prototype.mulTo=nMulTo;NullExp.prototype.sqrTo=nSqrTo;function bnPow(a){return this.exp(a,new NullExp())}function bnpMultiplyLowerTo(b,f,e){var d=Math.min(this.t+b.t,f);e.s=0;e.t=d;while(d>0){e[--d]=0}var c;for(c=e.t-this.t;d=0){d[c]=0}for(c=Math.max(e-this.t,0);c2*this.m.t){return a.mod(this.m)}else{if(a.compareTo(this.m)<0){return a}else{var b=nbi();a.copyTo(b);this.reduce(b);return b}}}function barrettRevert(a){return a}function barrettReduce(a){a.drShiftTo(this.m.t-1,this.r2);if(a.t>this.m.t+1){a.t=this.m.t+1;a.clamp()}this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);while(a.compareTo(this.r2)<0){a.dAddOffset(1,this.m.t+1)}a.subTo(this.r2,a);while(a.compareTo(this.m)>=0){a.subTo(this.m,a)}}function barrettSqrTo(a,b){a.squareTo(b);this.reduce(b)}function barrettMulTo(a,c,b){a.multiplyTo(c,b);this.reduce(b)}Barrett.prototype.convert=barrettConvert;Barrett.prototype.revert=barrettRevert;Barrett.prototype.reduce=barrettReduce;Barrett.prototype.mulTo=barrettMulTo;Barrett.prototype.sqrTo=barrettSqrTo;function bnModPow(q,f){var o=q.bitLength(),h,b=nbv(1),v;if(o<=0){return b}else{if(o<18){h=1}else{if(o<48){h=3}else{if(o<144){h=4}else{if(o<768){h=5}else{h=6}}}}}if(o<8){v=new Classic(f)}else{if(f.isEven()){v=new Barrett(f)}else{v=new Montgomery(f)}}var p=new Array(),d=3,s=h-1,a=(1<1){var A=nbi();v.sqrTo(p[1],A);while(d<=a){p[d]=nbi();v.mulTo(A,p[d-2],p[d]);d+=2}}var l=q.t-1,x,u=true,c=nbi(),y;o=nbits(q[l])-1;while(l>=0){if(o>=s){x=(q[l]>>(o-s))&a}else{x=(q[l]&((1<<(o+1))-1))<<(s-o);if(l>0){x|=q[l-1]>>(this.DB+o-s)}}d=h;while((x&1)==0){x>>=1;--d}if((o-=d)<0){o+=this.DB;--l}if(u){p[x].copyTo(b);u=false}else{while(d>1){v.sqrTo(b,c);v.sqrTo(c,b);d-=2}if(d>0){v.sqrTo(b,c)}else{y=b;b=c;c=y}v.mulTo(c,p[x],b)}while(l>=0&&(q[l]&(1<0){b.rShiftTo(f,b);h.rShiftTo(f,h)}while(b.signum()>0){if((d=b.getLowestSetBit())>0){b.rShiftTo(d,b)}if((d=h.getLowestSetBit())>0){h.rShiftTo(d,h)}if(b.compareTo(h)>=0){b.subTo(h,b);b.rShiftTo(1,b)}else{h.subTo(b,h);h.rShiftTo(1,h)}}if(f>0){h.lShiftTo(f,h)}return h}function bnpModInt(e){if(e<=0){return 0}var c=this.DV%e,b=(this.s<0)?e-1:0;if(this.t>0){if(c==0){b=this[0]%e}else{for(var a=this.t-1;a>=0;--a){b=(c*b+this[a])%e}}}return b}function bnModInverse(f){var j=f.isEven();if((this.isEven()&&j)||f.signum()==0){return BigInteger.ZERO}var i=f.clone(),h=this.clone();var g=nbv(1),e=nbv(0),l=nbv(0),k=nbv(1);while(i.signum()!=0){while(i.isEven()){i.rShiftTo(1,i);if(j){if(!g.isEven()||!e.isEven()){g.addTo(this,g);e.subTo(f,e)}g.rShiftTo(1,g)}else{if(!e.isEven()){e.subTo(f,e)}}e.rShiftTo(1,e)}while(h.isEven()){h.rShiftTo(1,h);if(j){if(!l.isEven()||!k.isEven()){l.addTo(this,l);k.subTo(f,k)}l.rShiftTo(1,l)}else{if(!k.isEven()){k.subTo(f,k)}}k.rShiftTo(1,k)}if(i.compareTo(h)>=0){i.subTo(h,i);if(j){g.subTo(l,g)}e.subTo(k,e)}else{h.subTo(i,h);if(j){l.subTo(g,l)}k.subTo(e,k)}}if(h.compareTo(BigInteger.ONE)!=0){return BigInteger.ZERO}if(k.compareTo(f)>=0){return k.subtract(f)}if(k.signum()<0){k.addTo(f,k)}else{return k}if(k.signum()<0){return k.add(f)}else{return k}}var lowprimes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];var lplim=(1<<26)/lowprimes[lowprimes.length-1];function bnIsProbablePrime(e){var d,b=this.abs();if(b.t==1&&b[0]<=lowprimes[lowprimes.length-1]){for(d=0;d>1;if(f>lowprimes.length){f=lowprimes.length}var b=nbi();for(var e=0;e>8)&255;rng_pool[rng_pptr++]^=(a>>16)&255;rng_pool[rng_pptr++]^=(a>>24)&255;if(rng_pptr>=rng_psize){rng_pptr-=rng_psize}}function rng_seed_time(){rng_seed_int(new Date().getTime())}if(rng_pool==null){rng_pool=new Array();rng_pptr=0;var t;if(window!==undefined&&(window.crypto!==undefined||window.msCrypto!==undefined)){var crypto=window.crypto||window.msCrypto;if(crypto.getRandomValues){var ua=new Uint8Array(32);crypto.getRandomValues(ua);for(t=0;t<32;++t){rng_pool[rng_pptr++]=ua[t]}}else{if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var z=window.crypto.random(32);for(t=0;t>>8;rng_pool[rng_pptr++]=t&255}rng_pptr=0;rng_seed_time()}function rng_get_byte(){if(rng_state==null){rng_seed_time();rng_state=prng_newstate();rng_state.init(rng_pool);for(rng_pptr=0;rng_pptr=0&&h>0){var f=e.charCodeAt(d--);if(f<128){g[--h]=f}else{if((f>127)&&(f<2048)){g[--h]=(f&63)|128;g[--h]=(f>>6)|192}else{g[--h]=(f&63)|128;g[--h]=((f>>6)&63)|128;g[--h]=(f>>12)|224}}}g[--h]=0;var b=new SecureRandom();var a=new Array();while(h>2){a[0]=0;while(a[0]==0){b.nextBytes(a)}g[--h]=a[0]}g[--h]=2;g[--h]=0;return new BigInteger(g)}function oaep_mgf1_arr(c,a,e){var b="",d=0;while(b.length>24,(d&16711680)>>16,(d&65280)>>8,d&255])));d+=1}return b}function oaep_pad(q,a,f,l){var c=KJUR.crypto.MessageDigest;var o=KJUR.crypto.Util;var b=null;if(!f){f="sha1"}if(typeof f==="string"){b=c.getCanonicalAlgName(f);l=c.getHashLength(b);f=function(i){return hextorstr(o.hashHex(rstrtohex(i),b))}}if(q.length+2*l+2>a){throw"Message too long for RSA"}var k="",e;for(e=0;e0&&a.length>0){this.n=parseBigInt(b,16);this.e=parseInt(a,16)}else{throw"Invalid RSA public key"}}}function RSADoPublic(a){return a.modPowInt(this.e,this.n)}function RSAEncrypt(d){var a=pkcs1pad2(d,(this.n.bitLength()+7)>>3);if(a==null){return null}var e=this.doPublic(a);if(e==null){return null}var b=e.toString(16);if((b.length&1)==0){return b}else{return"0"+b}}function RSAEncryptOAEP(f,e,b){var a=oaep_pad(f,(this.n.bitLength()+7)>>3,e,b);if(a==null){return null}var g=this.doPublic(a);if(g==null){return null}var d=g.toString(16);if((d.length&1)==0){return d}else{return"0"+d}}RSAKey.prototype.doPublic=RSADoPublic;RSAKey.prototype.setPublic=RSASetPublic;RSAKey.prototype.encrypt=RSAEncrypt;RSAKey.prototype.encryptOAEP=RSAEncryptOAEP;RSAKey.prototype.type="RSA"; /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */ function pkcs1unpad2(g,j){var a=g.toByteArray();var f=0;while(f=a.length){return null}}var e="";while(++f191)&&(h<224)){e+=String.fromCharCode(((h&31)<<6)|(a[f+1]&63));++f}else{e+=String.fromCharCode(((h&15)<<12)|((a[f+1]&63)<<6)|(a[f+2]&63));f+=2}}}return e}function oaep_mgf1_str(c,a,e){var b="",d=0;while(b.length>24,(d&16711680)>>16,(d&65280)>>8,d&255]));d+=1}return b}function oaep_unpad(o,b,g,p){var e=KJUR.crypto.MessageDigest;var r=KJUR.crypto.Util;var c=null;if(!g){g="sha1"}if(typeof g==="string"){c=e.getCanonicalAlgName(g);p=e.getHashLength(c);g=function(d){return hextorstr(r.hashHex(rstrtohex(d),c))}}o=o.toByteArray();var h;for(h=0;h0&&a.length>0){this.n=parseBigInt(c,16);this.e=parseInt(a,16);this.d=parseBigInt(b,16)}else{throw"Invalid RSA private key"}}}function RSASetPrivateEx(g,d,e,c,b,a,h,f){this.isPrivate=true;this.isPublic=false;if(g==null){throw"RSASetPrivateEx N == null"}if(d==null){throw"RSASetPrivateEx E == null"}if(g.length==0){throw"RSASetPrivateEx N.length == 0"}if(d.length==0){throw"RSASetPrivateEx E.length == 0"}if(g!=null&&d!=null&&g.length>0&&d.length>0){this.n=parseBigInt(g,16);this.e=parseInt(d,16);this.d=parseBigInt(e,16);this.p=parseBigInt(c,16);this.q=parseBigInt(b,16);this.dmp1=parseBigInt(a,16);this.dmq1=parseBigInt(h,16);this.coeff=parseBigInt(f,16)}else{throw"Invalid RSA private key in RSASetPrivateEx"}}function RSAGenerate(b,i){var a=new SecureRandom();var f=b>>1;this.e=parseInt(i,16);var c=new BigInteger(i,16);for(;;){for(;;){this.p=new BigInteger(b-f,1,a);if(this.p.subtract(BigInteger.ONE).gcd(c).compareTo(BigInteger.ONE)==0&&this.p.isProbablePrime(10)){break}}for(;;){this.q=new BigInteger(f,1,a);if(this.q.subtract(BigInteger.ONE).gcd(c).compareTo(BigInteger.ONE)==0&&this.q.isProbablePrime(10)){break}}if(this.p.compareTo(this.q)<=0){var h=this.p;this.p=this.q;this.q=h}var g=this.p.subtract(BigInteger.ONE);var d=this.q.subtract(BigInteger.ONE);var e=g.multiply(d);if(e.gcd(c).compareTo(BigInteger.ONE)==0){this.n=this.p.multiply(this.q);if(this.n.bitLength()==b){this.d=c.modInverse(e);this.dmp1=this.d.mod(g);this.dmq1=this.d.mod(d);this.coeff=this.q.modInverse(this.p);break}}}this.isPrivate=true}function RSADoPrivate(a){if(this.p==null||this.q==null){return a.modPow(this.d,this.n)}var c=a.mod(this.p).modPow(this.dmp1,this.p);var b=a.mod(this.q).modPow(this.dmq1,this.q);while(c.compareTo(b)<0){c=c.add(this.p)}return c.subtract(b).multiply(this.coeff).mod(this.p).multiply(this.q).add(b)}function RSADecrypt(b){if(b.length!=Math.ceil(this.n.bitLength()/4)){throw new Error("wrong ctext length")}var d=parseBigInt(b,16);var a=this.doPrivate(d);if(a==null){return null}return pkcs1unpad2(a,(this.n.bitLength()+7)>>3)}function RSADecryptOAEP(e,d,b){if(e.length!=Math.ceil(this.n.bitLength()/4)){throw new Error("wrong ctext length")}var f=parseBigInt(e,16);var a=this.doPrivate(f);if(a==null){return null}return oaep_unpad(a,(this.n.bitLength()+7)>>3,d,b)}RSAKey.prototype.doPrivate=RSADoPrivate;RSAKey.prototype.setPrivate=RSASetPrivate;RSAKey.prototype.setPrivateEx=RSASetPrivateEx;RSAKey.prototype.generate=RSAGenerate;RSAKey.prototype.decrypt=RSADecrypt;RSAKey.prototype.decryptOAEP=RSADecryptOAEP; /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */ function ECFieldElementFp(b,a){this.x=a;this.q=b}function feFpEquals(a){if(a==this){return true}return(this.q.equals(a.q)&&this.x.equals(a.x))}function feFpToBigInteger(){return this.x}function feFpNegate(){return new ECFieldElementFp(this.q,this.x.negate().mod(this.q))}function feFpAdd(a){return new ECFieldElementFp(this.q,this.x.add(a.toBigInteger()).mod(this.q))}function feFpSubtract(a){return new ECFieldElementFp(this.q,this.x.subtract(a.toBigInteger()).mod(this.q))}function feFpMultiply(a){return new ECFieldElementFp(this.q,this.x.multiply(a.toBigInteger()).mod(this.q))}function feFpSquare(){return new ECFieldElementFp(this.q,this.x.square().mod(this.q))}function feFpDivide(a){return new ECFieldElementFp(this.q,this.x.multiply(a.toBigInteger().modInverse(this.q)).mod(this.q))}ECFieldElementFp.prototype.equals=feFpEquals;ECFieldElementFp.prototype.toBigInteger=feFpToBigInteger;ECFieldElementFp.prototype.negate=feFpNegate;ECFieldElementFp.prototype.add=feFpAdd;ECFieldElementFp.prototype.subtract=feFpSubtract;ECFieldElementFp.prototype.multiply=feFpMultiply;ECFieldElementFp.prototype.square=feFpSquare;ECFieldElementFp.prototype.divide=feFpDivide;function ECPointFp(c,a,d,b){this.curve=c;this.x=a;this.y=d;if(b==null){this.z=BigInteger.ONE}else{this.z=b}this.zinv=null}function pointFpGetX(){if(this.zinv==null){this.zinv=this.z.modInverse(this.curve.q)}return this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}function pointFpGetY(){if(this.zinv==null){this.zinv=this.z.modInverse(this.curve.q)}return this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}function pointFpEquals(a){if(a==this){return true}if(this.isInfinity()){return a.isInfinity()}if(a.isInfinity()){return this.isInfinity()}var c,b;c=a.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(a.z)).mod(this.curve.q);if(!c.equals(BigInteger.ZERO)){return false}b=a.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(a.z)).mod(this.curve.q);return b.equals(BigInteger.ZERO)}function pointFpIsInfinity(){if((this.x==null)&&(this.y==null)){return true}return this.z.equals(BigInteger.ZERO)&&!this.y.toBigInteger().equals(BigInteger.ZERO)}function pointFpNegate(){return new ECPointFp(this.curve,this.x,this.y.negate(),this.z)}function pointFpAdd(l){if(this.isInfinity()){return l}if(l.isInfinity()){return this}var p=l.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(l.z)).mod(this.curve.q);var o=l.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(l.z)).mod(this.curve.q);if(BigInteger.ZERO.equals(o)){if(BigInteger.ZERO.equals(p)){return this.twice()}return this.curve.getInfinity()}var j=new BigInteger("3");var e=this.x.toBigInteger();var n=this.y.toBigInteger();var c=l.x.toBigInteger();var k=l.y.toBigInteger();var m=o.square();var i=m.multiply(o);var d=e.multiply(m);var g=p.square().multiply(this.z);var a=g.subtract(d.shiftLeft(1)).multiply(l.z).subtract(i).multiply(o).mod(this.curve.q);var h=d.multiply(j).multiply(p).subtract(n.multiply(i)).subtract(g.multiply(p)).multiply(l.z).add(p.multiply(i)).mod(this.curve.q);var f=i.multiply(this.z).multiply(l.z).mod(this.curve.q);return new ECPointFp(this.curve,this.curve.fromBigInteger(a),this.curve.fromBigInteger(h),f)}function pointFpTwice(){if(this.isInfinity()){return this}if(this.y.toBigInteger().signum()==0){return this.curve.getInfinity()}var g=new BigInteger("3");var c=this.x.toBigInteger();var h=this.y.toBigInteger();var e=h.multiply(this.z);var j=e.multiply(h).mod(this.curve.q);var i=this.curve.a.toBigInteger();var k=c.square().multiply(g);if(!BigInteger.ZERO.equals(i)){k=k.add(this.z.square().multiply(i))}k=k.mod(this.curve.q);var b=k.square().subtract(c.shiftLeft(3).multiply(j)).shiftLeft(1).multiply(e).mod(this.curve.q);var f=k.multiply(g).multiply(c).subtract(j.shiftLeft(1)).shiftLeft(2).multiply(j).subtract(k.square().multiply(k)).mod(this.curve.q);var d=e.square().multiply(e).shiftLeft(3).mod(this.curve.q);return new ECPointFp(this.curve,this.curve.fromBigInteger(b),this.curve.fromBigInteger(f),d)}function pointFpMultiply(d){if(this.isInfinity()){return this}if(d.signum()==0){return this.curve.getInfinity()}var m=d;var l=m.multiply(new BigInteger("3"));var b=this.negate();var j=this;var q=this.curve.q.subtract(d);var o=q.multiply(new BigInteger("3"));var c=new ECPointFp(this.curve,this.x,this.y);var a=c.negate();var g;for(g=l.bitLength()-2;g>0;--g){j=j.twice();var n=l.testBit(g);var f=m.testBit(g);if(n!=f){j=j.add(n?this:b)}}for(g=o.bitLength()-2;g>0;--g){c=c.twice();var p=o.testBit(g);var r=q.testBit(g);if(p!=r){c=c.add(p?c:a)}}return j}function pointFpMultiplyTwo(c,a,b){var d;if(c.bitLength()>b.bitLength()){d=c.bitLength()-1}else{d=b.bitLength()-1}var f=this.curve.getInfinity();var e=this.add(a);while(d>=0){f=f.twice();if(c.testBit(d)){if(b.testBit(d)){f=f.add(e)}else{f=f.add(this)}}else{if(b.testBit(d)){f=f.add(a)}}--d}return f}ECPointFp.prototype.getX=pointFpGetX;ECPointFp.prototype.getY=pointFpGetY;ECPointFp.prototype.equals=pointFpEquals;ECPointFp.prototype.isInfinity=pointFpIsInfinity;ECPointFp.prototype.negate=pointFpNegate;ECPointFp.prototype.add=pointFpAdd;ECPointFp.prototype.twice=pointFpTwice;ECPointFp.prototype.multiply=pointFpMultiply;ECPointFp.prototype.multiplyTwo=pointFpMultiplyTwo;function ECCurveFp(e,d,c){this.q=e;this.a=this.fromBigInteger(d);this.b=this.fromBigInteger(c);this.infinity=new ECPointFp(this,null,null)}function curveFpGetQ(){return this.q}function curveFpGetA(){return this.a}function curveFpGetB(){return this.b}function curveFpEquals(a){if(a==this){return true}return(this.q.equals(a.q)&&this.a.equals(a.a)&&this.b.equals(a.b))}function curveFpGetInfinity(){return this.infinity}function curveFpFromBigInteger(a){return new ECFieldElementFp(this.q,a)}function curveFpDecodePointHex(d){switch(parseInt(d.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:return null;case 4:case 6:case 7:var a=(d.length-2)/2;var c=d.substr(2,a);var b=d.substr(a+2,a);return new ECPointFp(this,this.fromBigInteger(new BigInteger(c,16)),this.fromBigInteger(new BigInteger(b,16)));default:return null}}ECCurveFp.prototype.getQ=curveFpGetQ;ECCurveFp.prototype.getA=curveFpGetA;ECCurveFp.prototype.getB=curveFpGetB;ECCurveFp.prototype.equals=curveFpEquals;ECCurveFp.prototype.getInfinity=curveFpGetInfinity;ECCurveFp.prototype.fromBigInteger=curveFpFromBigInteger;ECCurveFp.prototype.decodePointHex=curveFpDecodePointHex; /*! (c) Stefan Thomas | https://github.com/bitcoinjs/bitcoinjs-lib */ ECFieldElementFp.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)};ECPointFp.prototype.getEncoded=function(c){var d=function(h,f){var g=h.toByteArrayUnsigned();if(fg.length){g.unshift(0)}}return g};var a=this.getX().toBigInteger();var e=this.getY().toBigInteger();var b=d(a,32);if(c){if(e.isEven()){b.unshift(2)}else{b.unshift(3)}}else{b.unshift(4);b=b.concat(d(e,32))}return b};ECPointFp.decodeFrom=function(g,c){var f=c[0];var e=c.length-1;var d=c.slice(1,1+e/2);var b=c.slice(1+e/2,1+e);d.unshift(0);b.unshift(0);var a=new BigInteger(d);var h=new BigInteger(b);return new ECPointFp(g,g.fromBigInteger(a),g.fromBigInteger(h))};ECPointFp.decodeFromHex=function(g,c){var f=c.substr(0,2);var e=c.length-2;var d=c.substr(2,e/2);var b=c.substr(2+e/2,e/2);var a=new BigInteger(d,16);var h=new BigInteger(b,16);return new ECPointFp(g,g.fromBigInteger(a),g.fromBigInteger(h))};ECPointFp.prototype.add2D=function(c){if(this.isInfinity()){return c}if(c.isInfinity()){return this}if(this.x.equals(c.x)){if(this.y.equals(c.y)){return this.twice()}return this.curve.getInfinity()}var g=c.x.subtract(this.x);var e=c.y.subtract(this.y);var a=e.divide(g);var d=a.square().subtract(this.x).subtract(c.x);var f=a.multiply(this.x.subtract(d)).subtract(this.y);return new ECPointFp(this.curve,d,f)};ECPointFp.prototype.twice2D=function(){if(this.isInfinity()){return this}if(this.y.toBigInteger().signum()==0){return this.curve.getInfinity()}var b=this.curve.fromBigInteger(BigInteger.valueOf(2));var e=this.curve.fromBigInteger(BigInteger.valueOf(3));var a=this.x.square().multiply(e).add(this.curve.a).divide(this.y.multiply(b));var c=a.square().subtract(this.x.multiply(b));var d=a.multiply(this.x.subtract(c)).subtract(this.y);return new ECPointFp(this.curve,c,d)};ECPointFp.prototype.multiply2D=function(b){if(this.isInfinity()){return this}if(b.signum()==0){return this.curve.getInfinity()}var g=b;var f=g.multiply(new BigInteger("3"));var l=this.negate();var d=this;var c;for(c=f.bitLength()-2;c>0;--c){d=d.twice();var a=f.testBit(c);var j=g.testBit(c);if(a!=j){d=d.add2D(a?this:l)}}return d};ECPointFp.prototype.isOnCurve=function(){var d=this.getX().toBigInteger();var i=this.getY().toBigInteger();var f=this.curve.getA().toBigInteger();var c=this.curve.getB().toBigInteger();var h=this.curve.getQ();var e=i.multiply(i).mod(h);var g=d.multiply(d).multiply(d).add(f.multiply(d)).add(c).mod(h);return e.equals(g)};ECPointFp.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"};ECPointFp.prototype.validate=function(){var c=this.curve.getQ();if(this.isInfinity()){throw new Error("Point is at infinity.")}var a=this.getX().toBigInteger();var b=this.getY().toBigInteger();if(a.compareTo(BigInteger.ONE)<0||a.compareTo(c.subtract(BigInteger.ONE))>0){throw new Error("x coordinate out of bounds")}if(b.compareTo(BigInteger.ONE)<0||b.compareTo(c.subtract(BigInteger.ONE))>0){throw new Error("y coordinate out of bounds")}if(!this.isOnCurve()){throw new Error("Point is not on the curve.")}if(this.multiply(c).isInfinity()){throw new Error("Point is not a scalar multiple of G.")}return true}; /*! Mike Samuel (c) 2009 | code.google.com/p/json-sans-eval */ var jsonParse=(function(){var e="(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)";var j='(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))';var i='(?:"'+j+'*")';var d=new RegExp("(?:false|true|null|[\\{\\}\\[\\]]|"+e+"|"+i+")","g");var k=new RegExp("\\\\(?:([^u])|u(.{4}))","g");var g={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function h(l,m,n){return m?g[m]:String.fromCharCode(parseInt(n,16))}var c=new String("");var a="\\";var f={"{":Object,"[":Array};var b=Object.hasOwnProperty;return function(u,q){var p=u.match(d);var x;var v=p[0];var l=false;if("{"===v){x={}}else{if("["===v){x=[]}else{x=[];l=true}}var t;var r=[x];for(var o=1-l,m=p.length;o=0;){delete D[n[A]]}}}return q.call(C,B,D)};x=s({"":x},"")}return x}})(); if(typeof KJUR=="undefined"||!KJUR){KJUR={}}if(typeof KJUR.asn1=="undefined"||!KJUR.asn1){KJUR.asn1={}}KJUR.asn1.ASN1Util=new function(){this.integerToByteHex=function(a){var b=a.toString(16);if((b.length%2)==1){b="0"+b}return b};this.bigIntToMinTwosComplementsHex=function(j){var f=j.toString(16);if(f.substr(0,1)!="-"){if(f.length%2==1){f="0"+f}else{if(!f.match(/^[0-7]/)){f="00"+f}}}else{var a=f.substr(1);var e=a.length;if(e%2==1){e+=1}else{if(!f.match(/^[0-7]/)){e+=2}}var g="";for(var d=0;d15){throw"ASN.1 length too long to represent by 8x: n = "+i.toString(16)}var f=128+g;return f.toString(16)+h}};this.getEncodedHex=function(){if(this.hTLV==null||this.isModified){this.hV=this.getFreshValueHex();this.hL=this.getLengthHexFromValue();this.hTLV=this.hT+this.hL+this.hV;this.isModified=false}return this.hTLV};this.getValueHex=function(){this.getEncodedHex();return this.hV};this.getFreshValueHex=function(){return""}};KJUR.asn1.DERAbstractString=function(c){KJUR.asn1.DERAbstractString.superclass.constructor.call(this);var b=null;var a=null;this.getString=function(){return this.s};this.setString=function(d){this.hTLV=null;this.isModified=true;this.s=d;this.hV=utf8tohex(this.s).toLowerCase()};this.setStringHex=function(d){this.hTLV=null;this.isModified=true;this.s=null;this.hV=d};this.getFreshValueHex=function(){return this.hV};if(typeof c!="undefined"){if(typeof c=="string"){this.setString(c)}else{if(typeof c.str!="undefined"){this.setString(c.str)}else{if(typeof c.hex!="undefined"){this.setStringHex(c.hex)}}}}};YAHOO.lang.extend(KJUR.asn1.DERAbstractString,KJUR.asn1.ASN1Object);KJUR.asn1.DERAbstractTime=function(c){KJUR.asn1.DERAbstractTime.superclass.constructor.call(this);var b=null;var a=null;this.localDateToUTC=function(g){var e=g.getTime()+(g.getTimezoneOffset()*60000);var f=new Date(e);return f};this.formatDate=function(m,o,e){var g=this.zeroPadding;var n=this.localDateToUTC(m);var p=String(n.getFullYear());if(o=="utc"){p=p.substr(2,2)}var l=g(String(n.getMonth()+1),2);var q=g(String(n.getDate()),2);var h=g(String(n.getHours()),2);var i=g(String(n.getMinutes()),2);var j=g(String(n.getSeconds()),2);var r=p+l+q+h+i+j;if(e===true){var f=n.getMilliseconds();if(f!=0){var k=g(String(f),3);k=k.replace(/[0]+$/,"");r=r+"."+k}}return r+"Z"};this.zeroPadding=function(e,d){if(e.length>=d){return e}return new Array(d-e.length+1).join("0")+e};this.getString=function(){return this.s};this.setString=function(d){this.hTLV=null;this.isModified=true;this.s=d;this.hV=stohex(d)};this.setByDateValue=function(h,j,e,d,f,g){var i=new Date(Date.UTC(h,j-1,e,d,f,g,0));this.setByDate(i)};this.getFreshValueHex=function(){return this.hV}};YAHOO.lang.extend(KJUR.asn1.DERAbstractTime,KJUR.asn1.ASN1Object);KJUR.asn1.DERAbstractStructured=function(b){KJUR.asn1.DERAbstractString.superclass.constructor.call(this);var a=null;this.setByASN1ObjectArray=function(c){this.hTLV=null;this.isModified=true;this.asn1Array=c};this.appendASN1Object=function(c){this.hTLV=null;this.isModified=true;this.asn1Array.push(c)};this.asn1Array=new Array();if(typeof b!="undefined"){if(typeof b.array!="undefined"){this.asn1Array=b.array}}};YAHOO.lang.extend(KJUR.asn1.DERAbstractStructured,KJUR.asn1.ASN1Object);KJUR.asn1.DERBoolean=function(){KJUR.asn1.DERBoolean.superclass.constructor.call(this);this.hT="01";this.hTLV="0101ff"};YAHOO.lang.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object);KJUR.asn1.DERInteger=function(a){KJUR.asn1.DERInteger.superclass.constructor.call(this);this.hT="02";this.setByBigInteger=function(b){this.hTLV=null;this.isModified=true;this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(b)};this.setByInteger=function(c){var b=new BigInteger(String(c),10);this.setByBigInteger(b)};this.setValueHex=function(b){this.hV=b};this.getFreshValueHex=function(){return this.hV};if(typeof a!="undefined"){if(typeof a.bigint!="undefined"){this.setByBigInteger(a.bigint)}else{if(typeof a["int"]!="undefined"){this.setByInteger(a["int"])}else{if(typeof a=="number"){this.setByInteger(a)}else{if(typeof a.hex!="undefined"){this.setValueHex(a.hex)}}}}}};YAHOO.lang.extend(KJUR.asn1.DERInteger,KJUR.asn1.ASN1Object);KJUR.asn1.DERBitString=function(b){if(b!==undefined&&typeof b.obj!=="undefined"){var a=KJUR.asn1.ASN1Util.newObject(b.obj);b.hex="00"+a.getEncodedHex()}KJUR.asn1.DERBitString.superclass.constructor.call(this);this.hT="03";this.setHexValueIncludingUnusedBits=function(c){this.hTLV=null;this.isModified=true;this.hV=c};this.setUnusedBitsAndHexValue=function(c,e){if(c<0||7=(l*2))){break}if(d>=200){break}g.push(b);c=b;d++}return g};ASN1HEX.getNthChildIdx=function(d,b,e){var c=ASN1HEX.getChildIdx(d,b);return c[e]};ASN1HEX.getIdxbyList=function(e,d,c,i){var g=ASN1HEX;var f,b;if(c.length==0){if(i!==undefined){if(e.substr(d,2)!==i){throw Error("checking tag doesn't match: "+e.substr(d,2)+"!="+i)}}return d}f=c.shift();b=g.getChildIdx(e,d);return g.getIdxbyList(e,b[f],c,i)};ASN1HEX.getTLVbyList=function(d,c,b,f){var e=ASN1HEX;var a=e.getIdxbyList(d,c,b);if(a===undefined){throw"can't find nthList object"}if(f!==undefined){if(d.substr(a,2)!=f){throw"checking tag doesn't match: "+d.substr(a,2)+"!="+f}}return e.getTLV(d,a)};ASN1HEX.getVbyList=function(e,c,b,g,i){var f=ASN1HEX;var a,d;a=f.getIdxbyList(e,c,b,g);if(a===undefined){throw"can't find nthList object"}d=f.getV(e,a);if(i===true){d=d.substr(2)}return d};ASN1HEX.hextooidstr=function(e){var h=function(b,a){if(b.length>=a){return b}return new Array(a-b.length+1).join("0")+b};var l=[];var o=e.substr(0,2);var f=parseInt(o,16);l[0]=new String(Math.floor(f/40));l[1]=new String(f%40);var m=e.substr(2);var k=[];for(var g=0;g0){n=n+"."+j.join(".")}return n};ASN1HEX.dump=function(t,c,l,g){var p=ASN1HEX;var j=p.getV;var y=p.dump;var w=p.getChildIdx;var e=t;if(t instanceof KJUR.asn1.ASN1Object){e=t.getEncodedHex()}var q=function(A,i){if(A.length<=i*2){return A}else{var v=A.substr(0,i)+"..(total "+A.length/2+"bytes).."+A.substr(A.length-i,i);return v}};if(c===undefined){c={ommit_long_octet:32}}if(l===undefined){l=0}if(g===undefined){g=""}var x=c.ommit_long_octet;if(e.substr(l,2)=="01"){var h=j(e,l);if(h=="00"){return g+"BOOLEAN FALSE\n"}else{return g+"BOOLEAN TRUE\n"}}if(e.substr(l,2)=="02"){var h=j(e,l);return g+"INTEGER "+q(h,x)+"\n"}if(e.substr(l,2)=="03"){var h=j(e,l);return g+"BITSTRING "+q(h,x)+"\n"}if(e.substr(l,2)=="04"){var h=j(e,l);if(p.isASN1HEX(h)){var k=g+"OCTETSTRING, encapsulates\n";k=k+y(h,c,0,g+" ");return k}else{return g+"OCTETSTRING "+q(h,x)+"\n"}}if(e.substr(l,2)=="05"){return g+"NULL\n"}if(e.substr(l,2)=="06"){var m=j(e,l);var a=KJUR.asn1.ASN1Util.oidHexToInt(m);var o=KJUR.asn1.x509.OID.oid2name(a);var b=a.replace(/\./g," ");if(o!=""){return g+"ObjectIdentifier "+o+" ("+b+")\n"}else{return g+"ObjectIdentifier ("+b+")\n"}}if(e.substr(l,2)=="0c"){return g+"UTF8String '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="13"){return g+"PrintableString '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="14"){return g+"TeletexString '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="16"){return g+"IA5String '"+hextoutf8(j(e,l))+"'\n"}if(e.substr(l,2)=="17"){return g+"UTCTime "+hextoutf8(j(e,l))+"\n"}if(e.substr(l,2)=="18"){return g+"GeneralizedTime "+hextoutf8(j(e,l))+"\n"}if(e.substr(l,2)=="30"){if(e.substr(l,4)=="3000"){return g+"SEQUENCE {}\n"}var k=g+"SEQUENCE\n";var d=w(e,l);var f=c;if((d.length==2||d.length==3)&&e.substr(d[0],2)=="06"&&e.substr(d[d.length-1],2)=="04"){var o=p.oidname(j(e,d[0]));var r=JSON.parse(JSON.stringify(c));r.x509ExtName=o;f=r}for(var u=0;ur*2){throw new Error("L of TLV too long: idx="+o)}var n=s.getVblen(g,o);if(n>c){throw new Error("value of L too long than hex: idx="+o)}var q=s.getTLV(g,o);var f=q.length-2-s.getL(g,o).length;if(f!==(n*2)){throw new Error("V string length and L's value not the same:"+f+"/"+(n*2))}if(o===0){if(g.length!=q.length){throw new Error("total length and TLV length unmatch:"+g.length+"!="+q.length)}}var b=g.substr(o,2);if(b==="02"){var a=s.getVidx(g,o);if(g.substr(a,2)=="00"&&g.charCodeAt(a+2)<56){throw new Error("not least zeros for DER INTEGER")}}if(parseInt(b,16)&32){var p=s.getVblen(g,o);var m=0;var l=s.getChildIdx(g,o);for(var e=0;e0){var m=new f({array:this.extensionsArray});var k=new c({explicit:true,tag:"a3",obj:m});this.asn1Array.push(k)}var n=new f({array:this.asn1Array});this.hTLV=n.getEncodedHex();this.isModified=false;return this.hTLV};this._initialize()};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertificate,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extension=function(d){KJUR.asn1.x509.Extension.superclass.constructor.call(this);var f=null,a=KJUR,e=a.asn1,h=e.DERObjectIdentifier,i=e.DEROctetString,b=e.DERBitString,g=e.DERBoolean,c=e.DERSequence;this.getEncodedHex=function(){var m=new h({oid:this.oid});var l=new i({hex:this.getExtnValueHex()});var k=new Array();k.push(m);if(this.critical){k.push(new g())}k.push(l);var j=new c({array:k});return j.getEncodedHex()};this.critical=false;if(d!==undefined){if(d.critical!==undefined){this.critical=d.critical}}};YAHOO.lang.extend(KJUR.asn1.x509.Extension,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Extension.appendByNameToArray=function(e,c,b){var g=e.toLowerCase(),f=KJUR.asn1.x509;if(g=="basicconstraints"){var d=new f.BasicConstraints(c);b.push(d)}else{if(g=="keyusage"){var d=new f.KeyUsage(c);b.push(d)}else{if(g=="crldistributionpoints"){var d=new f.CRLDistributionPoints(c);b.push(d)}else{if(g=="extkeyusage"){var d=new f.ExtKeyUsage(c);b.push(d)}else{if(g=="authoritykeyidentifier"){var d=new f.AuthorityKeyIdentifier(c);b.push(d)}else{if(g=="subjectkeyidentifier"){var d=new f.SubjectKeyIdentifier(c);b.push(d)}else{if(g=="authorityinfoaccess"){var d=new f.AuthorityInfoAccess(c);b.push(d)}else{if(g=="subjectaltname"){var d=new f.SubjectAltName(c);b.push(d)}else{if(g=="issueraltname"){var d=new f.IssuerAltName(c);b.push(d)}else{throw"unsupported extension name: "+e}}}}}}}}}};KJUR.asn1.x509.KeyUsage=function(f){KJUR.asn1.x509.KeyUsage.superclass.constructor.call(this,f);var a=X509.KEYUSAGE_NAME;this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.15";if(f!==undefined){if(f.bin!==undefined){this.asn1ExtnValue=new KJUR.asn1.DERBitString(f)}if(f.names!==undefined&&f.names.length!==undefined){var e=f.names;var d="000000000";for(var c=0;c-1){e.push(new KJUR.asn1.DERInteger({"int":this.pathLen}))}var d=new KJUR.asn1.DERSequence({array:e});this.asn1ExtnValue=d;return this.asn1ExtnValue.getEncodedHex()};this.oid="2.5.29.19";this.cA=false;this.pathLen=-1;if(c!==undefined){if(c.cA!==undefined){this.cA=c.cA}if(c.pathLen!==undefined){this.pathLen=c.pathLen}}};YAHOO.lang.extend(KJUR.asn1.x509.BasicConstraints,KJUR.asn1.x509.Extension);KJUR.asn1.x509.CRLDistributionPoints=function(d){KJUR.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,d);var b=KJUR,a=b.asn1,c=a.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()};this.setByDPArray=function(e){this.asn1ExtnValue=new a.DERSequence({array:e})};this.setByOneURI=function(h){var e=new c.GeneralNames([{uri:h}]);var g=new c.DistributionPointName(e);var f=new c.DistributionPoint({dpobj:g});this.setByDPArray([f])};this.oid="2.5.29.31";if(d!==undefined){if(d.array!==undefined){this.setByDPArray(d.array)}else{if(d.uri!==undefined){this.setByOneURI(d.uri)}}}};YAHOO.lang.extend(KJUR.asn1.x509.CRLDistributionPoints,KJUR.asn1.x509.Extension);KJUR.asn1.x509.ExtKeyUsage=function(c){KJUR.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,c);var b=KJUR,a=b.asn1;this.setPurposeArray=function(d){this.asn1ExtnValue=new a.DERSequence();for(var e=0;e0){var h=new b({array:this.aRevokedCert});this.asn1Array.push(h)}var i=new b({array:this.asn1Array});this.hTLV=i.getEncodedHex();this.isModified=false;return this.hTLV};this._initialize=function(){this.asn1Version=null;this.asn1SignatureAlg=null;this.asn1Issuer=null;this.asn1ThisUpdate=null;this.asn1NextUpdate=null;this.aRevokedCert=new Array()};this._initialize()};YAHOO.lang.extend(KJUR.asn1.x509.TBSCertList,KJUR.asn1.ASN1Object);KJUR.asn1.x509.CRLEntry=function(e){KJUR.asn1.x509.CRLEntry.superclass.constructor.call(this);var d=null,c=null,b=KJUR,a=b.asn1;this.setCertSerial=function(f){this.sn=new a.DERInteger(f)};this.setRevocationDate=function(f){this.time=new a.x509.Time(f)};this.getEncodedHex=function(){var f=new a.DERSequence({array:[this.sn,this.time]});this.TLV=f.getEncodedHex();return this.TLV};if(e!==undefined){if(e.time!==undefined){this.setRevocationDate(e.time)}if(e.sn!==undefined){this.setCertSerial(e.sn)}}};YAHOO.lang.extend(KJUR.asn1.x509.CRLEntry,KJUR.asn1.ASN1Object);KJUR.asn1.x509.X500Name=function(f){KJUR.asn1.x509.X500Name.superclass.constructor.call(this);this.asn1Array=new Array();var d=KJUR,c=d.asn1,e=c.x509,b=pemtohex;this.setByString=function(g){var k=g.split("/");k.shift();var j=[];for(var l=0;l0;f++){var h=c.shift();if(e===true){var d=b.pop();var j=(d+","+h).replace(/\\,/g,",");b.push(j);e=false}else{b.push(h)}if(h.substr(-1,1)==="\\"){e=true}}b=b.map(function(a){return a.replace("/","\\/")});b.reverse();return"/"+b.join("/")};KJUR.asn1.x509.X500Name.ldapToOneline=function(a){return KJUR.asn1.x509.X500Name.ldapToCompat(a)};KJUR.asn1.x509.RDN=function(a){KJUR.asn1.x509.RDN.superclass.constructor.call(this);this.asn1Array=new Array();this.addByString=function(b){this.asn1Array.push(new KJUR.asn1.x509.AttributeTypeAndValue({str:b}))};this.addByMultiValuedString=function(d){var b=KJUR.asn1.x509.RDN.parseString(d);for(var c=0;c0;g++){var k=j.shift();if(h===true){var f=c.pop();var d=(f+"+"+k).replace(/\\\+/g,"+");c.push(d);h=false}else{c.push(k)}if(k.substr(-1,1)==="\\"){h=true}}var l=false;var b=[];for(var g=0;c.length>0;g++){var k=c.shift();if(l===true){var e=b.pop();if(k.match(/"$/)){var d=(e+"+"+k).replace(/^([^=]+)="(.*)"$/,"$1=$2");b.push(d);l=false}else{b.push(e+"+"+k)}}else{b.push(k)}if(k.match(/^[^=]+="/)){l=true}}return b};KJUR.asn1.x509.AttributeTypeAndValue=function(d){KJUR.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this);var f=null,e=null,a="utf8",c=KJUR,b=c.asn1;this.setByString=function(h){var g=h.match(/^([^=]+)=(.+)$/);if(g){this.setByAttrTypeAndValueStr(g[1],g[2])}else{throw"malformed attrTypeAndValueStr: "+h}};this.setByAttrTypeAndValueStr=function(i,h){this.typeObj=KJUR.asn1.x509.OID.atype2obj(i);var g=a;if(i=="C"){g="prn"}this.valueObj=this.getValueObj(g,h)};this.getValueObj=function(h,g){if(h=="utf8"){return new b.DERUTF8String({str:g})}if(h=="prn"){return new b.DERPrintableString({str:g})}if(h=="tel"){return new b.DERTeletexString({str:g})}if(h=="ia5"){return new b.DERIA5String({str:g})}throw"unsupported directory string type: type="+h+" value="+g};this.getEncodedHex=function(){var g=new b.DERSequence({array:[this.typeObj,this.valueObj]});this.TLV=g.getEncodedHex();return this.TLV};if(d!==undefined){if(d.str!==undefined){this.setByString(d.str)}}};YAHOO.lang.extend(KJUR.asn1.x509.AttributeTypeAndValue,KJUR.asn1.ASN1Object);KJUR.asn1.x509.SubjectPublicKeyInfo=function(f){KJUR.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var l=null,k=null,a=KJUR,j=a.asn1,i=j.DERInteger,b=j.DERBitString,m=j.DERObjectIdentifier,e=j.DERSequence,h=j.ASN1Util.newObject,d=j.x509,o=d.AlgorithmIdentifier,g=a.crypto,n=g.ECDSA,c=g.DSA;this.getASN1Object=function(){if(this.asn1AlgId==null||this.asn1SubjPKey==null){throw"algId and/or subjPubKey not set"}var p=new e({array:[this.asn1AlgId,this.asn1SubjPKey]});return p};this.getEncodedHex=function(){var p=this.getASN1Object();this.hTLV=p.getEncodedHex();return this.hTLV};this.setPubKey=function(q){try{if(q instanceof RSAKey){var u=h({seq:[{"int":{bigint:q.n}},{"int":{"int":q.e}}]});var s=u.getEncodedHex();this.asn1AlgId=new o({name:"rsaEncryption"});this.asn1SubjPKey=new b({hex:"00"+s})}}catch(p){}try{if(q instanceof KJUR.crypto.ECDSA){var r=new m({name:q.curveName});this.asn1AlgId=new o({name:"ecPublicKey",asn1params:r});this.asn1SubjPKey=new b({hex:"00"+q.pubKeyHex})}}catch(p){}try{if(q instanceof KJUR.crypto.DSA){var r=new h({seq:[{"int":{bigint:q.p}},{"int":{bigint:q.q}},{"int":{bigint:q.g}}]});this.asn1AlgId=new o({name:"dsa",asn1params:r});var t=new i({bigint:q.y});this.asn1SubjPKey=new b({hex:"00"+t.getEncodedHex()})}}catch(p){}};if(f!==undefined){this.setPubKey(f)}};YAHOO.lang.extend(KJUR.asn1.x509.SubjectPublicKeyInfo,KJUR.asn1.ASN1Object);KJUR.asn1.x509.Time=function(f){KJUR.asn1.x509.Time.superclass.constructor.call(this);var e=null,a=null,d=KJUR,c=d.asn1,b=c.DERUTCTime,g=c.DERGeneralizedTime;this.setTimeParams=function(h){this.timeParams=h};this.getEncodedHex=function(){var h=null;if(this.timeParams!=null){if(this.type=="utc"){h=new b(this.timeParams)}else{h=new g(this.timeParams)}}else{if(this.type=="utc"){h=new b()}else{h=new g()}}this.TLV=h.getEncodedHex();return this.TLV};this.type="utc";if(f!==undefined){if(f.type!==undefined){this.type=f.type}else{if(f.str!==undefined){if(f.str.match(/^[0-9]{12}Z$/)){this.type="utc"}if(f.str.match(/^[0-9]{14}Z$/)){this.type="gen"}}}this.timeParams=f}};YAHOO.lang.extend(KJUR.asn1.x509.Time,KJUR.asn1.ASN1Object);KJUR.asn1.x509.AlgorithmIdentifier=function(d){KJUR.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this);this.nameAlg=null;this.asn1Alg=null;this.asn1Params=null;this.paramEmpty=false;var b=KJUR,a=b.asn1;this.getEncodedHex=function(){if(this.nameAlg===null&&this.asn1Alg===null){throw"algorithm not specified"}if(this.nameAlg!==null&&this.asn1Alg===null){this.asn1Alg=a.x509.OID.name2obj(this.nameAlg)}var e=[this.asn1Alg];if(this.asn1Params!==null){e.push(this.asn1Params)}var f=new a.DERSequence({array:e});this.hTLV=f.getEncodedHex();return this.hTLV};if(d!==undefined){if(d.name!==undefined){this.nameAlg=d.name}if(d.asn1params!==undefined){this.asn1Params=d.asn1params}if(d.paramempty!==undefined){this.paramEmpty=d.paramempty}}if(this.asn1Params===null&&this.paramEmpty===false&&this.nameAlg!==null){var c=this.nameAlg.toLowerCase();if(c.substr(-7,7)!=="withdsa"&&c.substr(-9,9)!=="withecdsa"){this.asn1Params=new a.DERNull()}}};YAHOO.lang.extend(KJUR.asn1.x509.AlgorithmIdentifier,KJUR.asn1.ASN1Object);KJUR.asn1.x509.GeneralName=function(e){KJUR.asn1.x509.GeneralName.superclass.constructor.call(this);var m=null,i=null,k={rfc822:"81",dns:"82",dn:"a4",uri:"86",ip:"87"},b=KJUR,g=b.asn1,f=g.DERSequence,j=g.DEROctetString,d=g.DERIA5String,c=g.DERTaggedObject,l=g.ASN1Object,a=g.x509.X500Name,h=pemtohex;this.explicit=false;this.setByParam=function(p){var r=null;var u=null;if(p===undefined){return}if(p.rfc822!==undefined){this.type="rfc822";u=new d({str:p[this.type]})}if(p.dns!==undefined){this.type="dns";u=new d({str:p[this.type]})}if(p.uri!==undefined){this.type="uri";u=new d({str:p[this.type]})}if(p.dn!==undefined){this.type="dn";this.explicit=true;if(typeof p.dn==="string"){u=new a({str:p.dn})}else{if(p.dn instanceof KJUR.asn1.x509.X500Name){u=p.dn}else{u=new a(p.dn)}}}if(p.ldapdn!==undefined){this.type="dn";this.explicit=true;u=new a({ldapstr:p.ldapdn})}if(p.certissuer!==undefined){this.type="dn";this.explicit=true;var o=p.certissuer;var w=null;if(o.match(/^[0-9A-Fa-f]+$/)){w==o}if(o.indexOf("-----BEGIN ")!=-1){w=h(o)}if(w==null){throw"certissuer param not cert"}var t=new X509();t.hex=w;var y=t.getIssuerHex();u=new l();u.hTLV=y}if(p.certsubj!==undefined){this.type="dn";this.explicit=true;var o=p.certsubj;var w=null;if(o.match(/^[0-9A-Fa-f]+$/)){w==o}if(o.indexOf("-----BEGIN ")!=-1){w=h(o)}if(w==null){throw"certsubj param not cert"}var t=new X509();t.hex=w;var y=t.getSubjectHex();u=new l();u.hTLV=y}if(p.ip!==undefined){this.type="ip";this.explicit=false;var q=p.ip;var s;var n="malformed IP address";if(q.match(/^[0-9.]+[.][0-9.]+$/)){s=intarystrtohex("["+q.split(".").join(",")+"]");if(s.length!==8){throw n}}else{if(q.match(/^[0-9A-Fa-f:]+:[0-9A-Fa-f:]+$/)){s=ipv6tohex(q)}else{if(q.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/)){s=q}else{throw n}}}u=new j({hex:s})}if(this.type==null){throw"unsupported type in params="+p}this.asn1Obj=new c({explicit:this.explicit,tag:k[this.type],obj:u})};this.getEncodedHex=function(){return this.asn1Obj.getEncodedHex()};if(e!==undefined){this.setByParam(e)}};YAHOO.lang.extend(KJUR.asn1.x509.GeneralName,KJUR.asn1.ASN1Object);KJUR.asn1.x509.GeneralNames=function(d){KJUR.asn1.x509.GeneralNames.superclass.constructor.call(this);var a=null,c=KJUR,b=c.asn1;this.setByParamArray=function(g){for(var e=0;e0){r=new b({obj:this.dUnsignedAttrs,tag:"a1",explicit:false})}var q=[this.dCMSVersion,this.dSignerIdentifier,this.dDigestAlgorithm,o,this.dSigAlg,this.dSig,];if(r!=null){q.push(r)}var p=new h.DERSequence({array:q});this.hTLV=p.getEncodedHex();return this.hTLV}};YAHOO.lang.extend(KJUR.asn1.cms.SignerInfo,KJUR.asn1.ASN1Object);KJUR.asn1.cms.EncapsulatedContentInfo=function(g){var c=KJUR,b=c.asn1,e=b.DERTaggedObject,a=b.DERSequence,h=b.DERObjectIdentifier,d=b.DEROctetString,f=b.cms;f.EncapsulatedContentInfo.superclass.constructor.call(this);this.dEContentType=new h({name:"data"});this.dEContent=null;this.isDetached=false;this.eContentValueHex=null;this.setContentType=function(i){if(i.match(/^[0-2][.][0-9.]+$/)){this.dEContentType=new h({oid:i})}else{this.dEContentType=new h({name:i})}};this.setContentValue=function(i){if(i!==undefined){if(typeof i.hex=="string"){this.eContentValueHex=i.hex}else{if(typeof i.str=="string"){this.eContentValueHex=utf8tohex(i.str)}}}};this.setContentValueHex=function(i){this.eContentValueHex=i};this.setContentValueStr=function(i){this.eContentValueHex=utf8tohex(i)};this.getEncodedHex=function(){if(typeof this.eContentValueHex!="string"){throw"eContentValue not yet set"}var k=new d({hex:this.eContentValueHex});this.dEContent=new e({obj:k,tag:"a0",explicit:true});var i=[this.dEContentType];if(!this.isDetached){i.push(this.dEContent)}var j=new a({array:i});this.hTLV=j.getEncodedHex();return this.hTLV}};YAHOO.lang.extend(KJUR.asn1.cms.EncapsulatedContentInfo,KJUR.asn1.ASN1Object);KJUR.asn1.cms.ContentInfo=function(f){var c=KJUR,b=c.asn1,d=b.DERTaggedObject,a=b.DERSequence,e=b.x509;KJUR.asn1.cms.ContentInfo.superclass.constructor.call(this);this.dContentType=null;this.dContent=null;this.setContentType=function(g){if(typeof g=="string"){this.dContentType=e.OID.name2obj(g)}};this.getEncodedHex=function(){var h=new d({obj:this.dContent,tag:"a0",explicit:true});var g=new a({array:[this.dContentType,h]});this.hTLV=g.getEncodedHex();return this.hTLV};if(f!==undefined){if(f.type){this.setContentType(f.type)}if(f.obj&&f.obj instanceof b.ASN1Object){this.dContent=f.obj}}};YAHOO.lang.extend(KJUR.asn1.cms.ContentInfo,KJUR.asn1.ASN1Object);KJUR.asn1.cms.SignedData=function(e){var a=KJUR,h=a.asn1,j=h.ASN1Object,g=h.DERInteger,m=h.DERSet,f=h.DERSequence,b=h.DERTaggedObject,l=h.cms,i=l.EncapsulatedContentInfo,d=l.SignerInfo,n=l.ContentInfo,c=h.x509,k=c.AlgorithmIdentifier;KJUR.asn1.cms.SignedData.superclass.constructor.call(this);this.dCMSVersion=new g({"int":1});this.dDigestAlgs=null;this.digestAlgNameList=[];this.dEncapContentInfo=new i();this.dCerts=null;this.certificateList=[];this.crlList=[];this.signerInfoList=[new d()];this.addCertificatesByPEM=function(p){var q=pemtohex(p);var r=new j();r.hTLV=q;this.certificateList.push(r)};this.getEncodedHex=function(){if(typeof this.hTLV=="string"){return this.hTLV}if(this.dDigestAlgs==null){var u=[];for(var t=0;t0){var v=new m({array:this.certificateList});this.dCerts=new b({obj:v,tag:"a0",explicit:false})}}if(this.dCerts!=null){p.push(this.dCerts)}var r=new m({array:this.signerInfoList});p.push(r);var q=new f({array:p});this.hTLV=q.getEncodedHex();return this.hTLV};this.getContentInfo=function(){this.getEncodedHex();var o=new n({type:"signed-data",obj:this});return o};this.getContentInfoEncodedHex=function(){var o=this.getContentInfo();var p=o.getEncodedHex();return p};this.getPEM=function(){return hextopem(this.getContentInfoEncodedHex(),"CMS")}};YAHOO.lang.extend(KJUR.asn1.cms.SignedData,KJUR.asn1.ASN1Object);KJUR.asn1.cms.CMSUtil=new function(){};KJUR.asn1.cms.CMSUtil.newSignedData=function(d){var b=KJUR,j=b.asn1,q=j.cms,f=q.SignerInfo,n=q.SignedData,o=q.SigningTime,a=q.SigningCertificate,p=q.SigningCertificateV2,c=j.cades,e=c.SignaturePolicyIdentifier;var m=new n();m.dEncapContentInfo.setContentValue(d.content);if(typeof d.detached=="boolean"){m.dEncapContentInfo.isDetached=d.detached}if(typeof d.certs=="object"){for(var h=0;h0){var s=new f({array:this.extensionsArray});var r=new m({array:[s]});var q=new f({array:[new k({oid:"1.2.840.113549.1.9.14"}),r]});var p=new c({explicit:true,tag:"a0",obj:q});this.asn1Array.push(p)}else{var p=new c({explicit:false,tag:"a0",obj:new j()});this.asn1Array.push(p)}var t=new f({array:this.asn1Array});this.hTLV=t.getEncodedHex();this.isModified=false;return this.hTLV};this._initialize()};YAHOO.lang.extend(KJUR.asn1.csr.CertificationRequestInfo,KJUR.asn1.ASN1Object);KJUR.asn1.csr.CSRUtil=new function(){};KJUR.asn1.csr.CSRUtil.newCSRPEM=function(h){var c=KEYUTIL,b=KJUR.asn1.csr;if(h.subject===undefined){throw"parameter subject undefined"}if(h.sbjpubkey===undefined){throw"parameter sbjpubkey undefined"}if(h.sigalg===undefined){throw"parameter sigalg undefined"}if(h.sbjprvkey===undefined){throw"parameter sbjpubkey undefined"}var d=new b.CertificationRequestInfo();d.setSubjectByParam(h.subject);d.setSubjectPublicKeyByGetKey(h.sbjpubkey);if(h.ext!==undefined&&h.ext.length!==undefined){for(var e=0;ef.length){f=c[d]}}e=e.replace(f,"::");return e.slice(1,-1)}function hextoip(b){var d="malformed hex value";if(!b.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/)){throw d}if(b.length==8){var c;try{c=parseInt(b.substr(0,2),16)+"."+parseInt(b.substr(2,2),16)+"."+parseInt(b.substr(4,2),16)+"."+parseInt(b.substr(6,2),16);return c}catch(a){throw d}}else{if(b.length==32){return hextoipv6(b)}else{return b}}}function iptohex(f){var j="malformed IP address";f=f.toLowerCase(f);if(f.match(/^[0-9.]+$/)){var b=f.split(".");if(b.length!==4){throw j}var g="";try{for(var e=0;e<4;e++){var h=parseInt(b[e]);g+=("0"+h.toString(16)).slice(-2)}return g}catch(c){throw j}}else{if(f.match(/^[0-9a-f:]+$/)&&f.indexOf(":")!==-1){return ipv6tohex(f)}else{throw j}}}function encodeURIComponentAll(a){var d=encodeURIComponent(a);var b="";for(var c=0;c"7"){return"00"+a}return a}function intarystrtohex(b){b=b.replace(/^\s*\[\s*/,"");b=b.replace(/\s*\]\s*$/,"");b=b.replace(/\s*/g,"");try{var c=b.split(/,/).map(function(g,e,h){var f=parseInt(g);if(f<0||255a.length){d=a.length}for(var b=0;bd){throw"key is too short for SigAlg: keylen="+j+","+a}var b="0001";var k="00"+c;var g="";var l=d-b.length-k.length;for(var f=0;f=0;--q){r=r.twice2D();r.z=e.ONE;if(p.testBit(q)){if(o.testBit(q)){r=r.add2D(u)}else{r=r.add2D(t)}}else{if(o.testBit(q)){r=r.add2D(s)}}}return r}this.getBigRandom=function(m){return new e(m.bitLength(),a).mod(m.subtract(e.ONE)).add(e.ONE)};this.setNamedCurve=function(m){this.ecparams=c.getByName(m);this.prvKeyHex=null;this.pubKeyHex=null;this.curveName=m};this.setPrivateKeyHex=function(m){this.isPrivate=true;this.prvKeyHex=m};this.setPublicKeyHex=function(m){this.isPublic=true;this.pubKeyHex=m};this.getPublicKeyXYHex=function(){var o=this.pubKeyHex;if(o.substr(0,2)!=="04"){throw"this method supports uncompressed format(04) only"}var n=this.ecparams.keylen/4;if(o.length!==2+n*2){throw"malformed public key hex length"}var m={};m.x=o.substr(2,n);m.y=o.substr(2+n);return m};this.getShortNISTPCurveName=function(){var m=this.curveName;if(m==="secp256r1"||m==="NIST P-256"||m==="P-256"||m==="prime256v1"){return"P-256"}if(m==="secp384r1"||m==="NIST P-384"||m==="P-384"){return"P-384"}return null};this.generateKeyPairHex=function(){var o=this.ecparams.n;var r=this.getBigRandom(o);var p=this.ecparams.G.multiply(r);var u=p.getX().toBigInteger();var s=p.getY().toBigInteger();var m=this.ecparams.keylen/4;var q=("0000000000"+r.toString(16)).slice(-m);var v=("0000000000"+u.toString(16)).slice(-m);var t=("0000000000"+s.toString(16)).slice(-m);var n="04"+v+t;this.setPrivateKeyHex(q);this.setPublicKeyHex(n);return{ecprvhex:q,ecpubhex:n}};this.signWithMessageHash=function(m){return this.signHex(m,this.prvKeyHex)};this.signHex=function(t,o){var w=new e(o,16);var p=this.ecparams.n;var v=new e(t.substring(0,this.ecparams.keylen/4),16);do{var q=this.getBigRandom(p);var x=this.ecparams.G;var u=x.multiply(q);var m=u.getX().toBigInteger().mod(p)}while(m.compareTo(e.ZERO)<=0);var y=q.modInverse(p).multiply(v.add(w.multiply(m))).mod(p);return j.biRSSigToASN1Sig(m,y)};this.sign=function(q,x){var v=x;var o=this.ecparams.n;var u=e.fromByteArrayUnsigned(q);do{var p=this.getBigRandom(o);var w=this.ecparams.G;var t=w.multiply(p);var m=t.getX().toBigInteger().mod(o)}while(m.compareTo(BigInteger.ZERO)<=0);var y=p.modInverse(o).multiply(u.add(v.multiply(m))).mod(o);return this.serializeSig(m,y)};this.verifyWithMessageHash=function(n,m){return this.verifyHex(n,m,this.pubKeyHex)};this.verifyHex=function(o,t,n){try{var m,w;var p=j.parseSigHex(t);m=p.r;w=p.s;var q=g.decodeFromHex(this.ecparams.curve,n);var u=new e(o.substring(0,this.ecparams.keylen/4),16);return this.verifyRaw(u,m,w,q)}catch(v){return false}};this.verify=function(u,v,n){var p,m;if(Bitcoin.Util.isArray(v)){var t=this.parseSig(v);p=t.r;m=t.s}else{if("object"===typeof v&&v.r&&v.s){p=v.r;m=v.s}else{throw"Invalid value for signature"}}var o;if(n instanceof ECPointFp){o=n}else{if(Bitcoin.Util.isArray(n)){o=g.decodeFrom(this.ecparams.curve,n)}else{throw"Invalid format for pubkey value, must be byte array or ECPointFp"}}var q=e.fromByteArrayUnsigned(u);return this.verifyRaw(q,p,m,o)};this.verifyRaw=function(u,m,A,t){var q=this.ecparams.n;var z=this.ecparams.G;if(m.compareTo(e.ONE)<0||m.compareTo(q)>=0){return false}if(A.compareTo(e.ONE)<0||A.compareTo(q)>=0){return false}var w=A.modInverse(q);var p=u.multiply(w).mod(q);var o=m.multiply(w).mod(q);var x=z.multiply(p).add(t.multiply(o));var y=x.getX().toBigInteger().mod(q);return y.equals(m)};this.serializeSig=function(o,n){var p=o.toByteArraySigned();var m=n.toByteArraySigned();var q=[];q.push(2);q.push(p.length);q=q.concat(p);q.push(2);q.push(m.length);q=q.concat(m);q.unshift(q.length);q.unshift(48);return q};this.parseSig=function(t){var q;if(t[0]!=48){throw new Error("Signature not a valid DERSequence")}q=2;if(t[q]!=2){throw new Error("First element in signature must be a DERInteger")}var p=t.slice(q+2,q+2+t[q+1]);q+=2+t[q+1];if(t[q]!=2){throw new Error("Second element in signature must be a DERInteger")}var m=t.slice(q+2,q+2+t[q+1]);q+=2+t[q+1];var o=e.fromByteArrayUnsigned(p);var n=e.fromByteArrayUnsigned(m);return{r:o,s:n}};this.parseSigCompact=function(q){if(q.length!==65){throw"Signature has the wrong length"}var m=q[0]-27;if(m<0||m>7){throw"Invalid signature type"}var t=this.ecparams.n;var p=e.fromByteArrayUnsigned(q.slice(1,33)).mod(t);var o=e.fromByteArrayUnsigned(q.slice(33,65)).mod(t);return{r:p,s:o,i:m}};this.readPKCS5PrvKeyHex=function(p){var r=ASN1HEX,q=j.getName,t=r.getVbyList;if(r.isASN1HEX(p)===false){throw"not ASN.1 hex string"}var m,o,s;try{m=t(p,0,[2,0],"06");o=t(p,0,[1],"04");try{s=t(p,0,[3,0],"03").substr(2)}catch(n){}}catch(n){throw"malformed PKCS#1/5 plain ECC private key"}this.curveName=q(m);if(this.curveName===undefined){throw"unsupported curve name"}this.setNamedCurve(this.curveName);this.setPublicKeyHex(s);this.setPrivateKeyHex(o);this.isPublic=false};this.readPKCS8PrvKeyHex=function(p){var u=ASN1HEX;var m=KJUR.crypto.ECDSA.getName;var r=u.getVbyList;if(u.isASN1HEX(p)===false){throw"not ASN.1 hex string"}var n,t,q,o;try{n=r(p,0,[1,0],"06");t=r(p,0,[1,1],"06");q=r(p,0,[2,0,1],"04");try{o=r(p,0,[2,0,2,0],"03").substr(2)}catch(s){}}catch(s){throw"malformed PKCS#8 plain ECC private key"}this.curveName=m(t);if(this.curveName===undefined){throw"unsupported curve name"}this.setNamedCurve(this.curveName);this.setPublicKeyHex(o);this.setPrivateKeyHex(q);this.isPublic=false};this.readPKCS8PubKeyHex=function(p){var r=ASN1HEX;var q=KJUR.crypto.ECDSA.getName;var t=r.getVbyList;if(r.isASN1HEX(p)===false){throw"not ASN.1 hex string"}var o,m,s;try{o=t(p,0,[0,0],"06");m=t(p,0,[0,1],"06");s=t(p,0,[1],"03").substr(2)}catch(n){throw"malformed PKCS#8 ECC public key"}this.curveName=q(m);if(this.curveName===null){throw"unsupported curve name"}this.setNamedCurve(this.curveName);this.setPublicKeyHex(s)};this.readCertPubKeyHex=function(o,t){if(t!==5){t=6}var q=ASN1HEX;var p=j.getName;var s=q.getVbyList;if(q.isASN1HEX(o)===false){throw"not ASN.1 hex string"}var m,r;try{m=s(o,0,[0,t,0,1],"06");r=s(o,0,[0,t,1],"03").substr(2)}catch(n){throw"malformed X.509 certificate ECC public key"}this.curveName=p(m);if(this.curveName===null){throw"unsupported curve name"}this.setNamedCurve(this.curveName);this.setPublicKeyHex(r)};if(d!==undefined){if(d.curve!==undefined){this.curveName=d.curve}}if(this.curveName===undefined){this.curveName=f}this.setNamedCurve(this.curveName);if(d!==undefined){if(d.prv!==undefined){this.setPrivateKeyHex(d.prv)}if(d.pub!==undefined){this.setPublicKeyHex(d.pub)}}};KJUR.crypto.ECDSA.parseSigHex=function(a){var b=KJUR.crypto.ECDSA.parseSigHexInHexRS(a);var d=new BigInteger(b.r,16);var c=new BigInteger(b.s,16);return{r:d,s:c}};KJUR.crypto.ECDSA.parseSigHexInHexRS=function(f){var j=ASN1HEX,i=j.getChildIdx,g=j.getV;j.checkStrictDER(f,0);if(f.substr(0,2)!="30"){throw new Error("signature is not a ASN.1 sequence")}var h=i(f,0);if(h.length!=2){throw new Error("signature shall have two elements")}var e=h[0];var d=h[1];if(f.substr(e,2)!="02"){throw new Error("1st item not ASN.1 integer")}if(f.substr(d,2)!="02"){throw new Error("2nd item not ASN.1 integer")}var c=g(f,e);var b=g(f,d);return{r:c,s:b}};KJUR.crypto.ECDSA.asn1SigToConcatSig=function(c){var d=KJUR.crypto.ECDSA.parseSigHexInHexRS(c);var b=d.r;var a=d.s;if(b.substr(0,2)=="00"&&(b.length%32)==2){b=b.substr(2)}if(a.substr(0,2)=="00"&&(a.length%32)==2){a=a.substr(2)}if((b.length%32)==30){b="00"+b}if((a.length%32)==30){a="00"+a}if(b.length%32!=0){throw"unknown ECDSA sig r length error"}if(a.length%32!=0){throw"unknown ECDSA sig s length error"}return b+a};KJUR.crypto.ECDSA.concatSigToASN1Sig=function(a){if((((a.length/2)*8)%(16*8))!=0){throw"unknown ECDSA concatinated r-s sig length error"}var c=a.substr(0,a.length/2);var b=a.substr(a.length/2);return KJUR.crypto.ECDSA.hexRSSigToASN1Sig(c,b)};KJUR.crypto.ECDSA.hexRSSigToASN1Sig=function(b,a){var d=new BigInteger(b,16);var c=new BigInteger(a,16);return KJUR.crypto.ECDSA.biRSSigToASN1Sig(d,c)};KJUR.crypto.ECDSA.biRSSigToASN1Sig=function(f,d){var c=KJUR.asn1;var b=new c.DERInteger({bigint:f});var a=new c.DERInteger({bigint:d});var e=new c.DERSequence({array:[b,a]});return e.getEncodedHex()};KJUR.crypto.ECDSA.getName=function(a){if(a==="2b8104001f"){return"secp192k1"}if(a==="2a8648ce3d030107"){return"secp256r1"}if(a==="2b8104000a"){return"secp256k1"}if(a==="2b81040021"){return"secp224r1"}if(a==="2b81040022"){return"secp384r1"}if("|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(a)!==-1){return"secp256r1"}if("|secp256k1|".indexOf(a)!==-1){return"secp256k1"}if("|secp224r1|NIST P-224|P-224|".indexOf(a)!==-1){return"secp224r1"}if("|secp384r1|NIST P-384|P-384|".indexOf(a)!==-1){return"secp384r1"}return null}; if(typeof KJUR=="undefined"||!KJUR){KJUR={}}if(typeof KJUR.crypto=="undefined"||!KJUR.crypto){KJUR.crypto={}}KJUR.crypto.ECParameterDB=new function(){var b={};var c={};function a(d){return new BigInteger(d,16)}this.getByName=function(e){var d=e;if(typeof c[d]!="undefined"){d=c[e]}if(typeof b[d]!="undefined"){return b[d]}throw"unregistered EC curve name: "+d};this.regist=function(A,l,o,g,m,e,j,f,k,u,d,x){b[A]={};var s=a(o);var z=a(g);var y=a(m);var t=a(e);var w=a(j);var r=new ECCurveFp(s,z,y);var q=r.decodePointHex("04"+f+k);b[A]["name"]=A;b[A]["keylen"]=l;b[A]["curve"]=r;b[A]["G"]=q;b[A]["n"]=t;b[A]["h"]=w;b[A]["oid"]=d;b[A]["info"]=x;for(var v=0;v1){g=new BigInteger(i,16)}else{g=null}h=new BigInteger(j,16);this.setPrivate(c,a,e,g,h)};this.setPublic=function(c,b,a,d){this.isPublic=true;this.p=c;this.q=b;this.g=a;this.y=d;this.x=null};this.setPublicHex=function(f,e,d,g){var b,a,h,c;b=new BigInteger(f,16);a=new BigInteger(e,16);h=new BigInteger(d,16);c=new BigInteger(g,16);this.setPublic(b,a,h,c)};this.signWithMessageHash=function(d){var c=this.p;var b=this.q;var f=this.g;var i=this.y;var j=this.x;var e=KJUR.crypto.Util.getRandomBigIntegerMinToMax(BigInteger.ONE.add(BigInteger.ONE),b.subtract(BigInteger.ONE));var l=d.substr(0,b.bitLength()/4);var h=new BigInteger(l,16);var a=(f.modPow(e,c)).mod(b);var n=(e.modInverse(b).multiply(h.add(j.multiply(a)))).mod(b);var m=KJUR.asn1.ASN1Util.jsonToASN1HEX({seq:[{"int":{bigint:a}},{"int":{bigint:n}}]});return m};this.verifyWithMessageHash=function(h,f){var d=this.p;var b=this.q;var j=this.g;var l=this.y;var i=this.parseASN1Signature(f);var a=i[0];var t=i[1];var o=h.substr(0,b.bitLength()/4);var k=new BigInteger(o,16);if(BigInteger.ZERO.compareTo(a)>0||a.compareTo(b)>0){throw"invalid DSA signature"}if(BigInteger.ZERO.compareTo(t)>=0||t.compareTo(b)>0){throw"invalid DSA signature"}var m=t.modInverse(b);var e=k.multiply(m).mod(b);var c=a.multiply(m).mod(b);var n=j.modPow(e,d).multiply(l.modPow(c,d)).mod(d).mod(b);return n.compareTo(a)==0};this.parseASN1Signature=function(a){try{var d=new BigInteger(ASN1HEX.getVbyList(a,0,[0],"02"),16);var c=new BigInteger(ASN1HEX.getVbyList(a,0,[1],"02"),16);return[d,c]}catch(b){throw"malformed ASN.1 DSA signature"}};this.readPKCS5PrvKeyHex=function(c){var b,a,f,g,i;var j=ASN1HEX;var d=j.getVbyList;if(j.isASN1HEX(c)===false){throw"not ASN.1 hex string"}try{b=d(c,0,[1],"02");a=d(c,0,[2],"02");f=d(c,0,[3],"02");g=d(c,0,[4],"02");i=d(c,0,[5],"02")}catch(e){console.log("EXCEPTION:"+e);throw"malformed PKCS#1/5 plain DSA private key"}this.setPrivateHex(b,a,f,g,i)};this.readPKCS8PrvKeyHex=function(d){var f,c,b,g;var e=ASN1HEX;var i=e.getVbyList;if(e.isASN1HEX(d)===false){throw"not ASN.1 hex string"}try{f=i(d,0,[1,1,0],"02");c=i(d,0,[1,1,1],"02");b=i(d,0,[1,1,2],"02");g=i(d,0,[2,0],"02")}catch(a){console.log("EXCEPTION:"+a);throw"malformed PKCS#8 plain DSA private key"}this.setPrivateHex(f,c,b,null,g)};this.readPKCS8PubKeyHex=function(d){var f,c,b,g;var e=ASN1HEX;var i=e.getVbyList;if(e.isASN1HEX(d)===false){throw"not ASN.1 hex string"}try{f=i(d,0,[0,1,0],"02");c=i(d,0,[0,1,1],"02");b=i(d,0,[0,1,2],"02");g=i(d,0,[1,0],"02")}catch(a){console.log("EXCEPTION:"+a);throw"malformed PKCS#8 DSA public key"}this.setPublicHex(f,c,b,g)};this.readCertPubKeyHex=function(c,f){if(f!==5){f=6}var b,a,g,i;var j=ASN1HEX;var d=j.getVbyList;if(j.isASN1HEX(c)===false){throw"not ASN.1 hex string"}try{b=d(c,0,[0,f,0,1,0],"02");a=d(c,0,[0,f,0,1,1],"02");g=d(c,0,[0,f,0,1,2],"02");i=d(c,0,[0,f,1,0],"02")}catch(e){console.log("EXCEPTION:"+e);throw"malformed X.509 certificate DSA public key"}this.setPublicHex(b,a,g,i)}}; var KEYUTIL=function(){var d=function(p,r,q){return k(CryptoJS.AES,p,r,q)};var e=function(p,r,q){return k(CryptoJS.TripleDES,p,r,q)};var a=function(p,r,q){return k(CryptoJS.DES,p,r,q)};var k=function(s,x,u,q){var r=CryptoJS.enc.Hex.parse(x);var w=CryptoJS.enc.Hex.parse(u);var p=CryptoJS.enc.Hex.parse(q);var t={};t.key=w;t.iv=p;t.ciphertext=r;var v=s.decrypt(t,w,{iv:p});return CryptoJS.enc.Hex.stringify(v)};var l=function(p,r,q){return g(CryptoJS.AES,p,r,q)};var o=function(p,r,q){return g(CryptoJS.TripleDES,p,r,q)};var f=function(p,r,q){return g(CryptoJS.DES,p,r,q)};var g=function(t,y,v,q){var s=CryptoJS.enc.Hex.parse(y);var x=CryptoJS.enc.Hex.parse(v);var p=CryptoJS.enc.Hex.parse(q);var w=t.encrypt(s,x,{iv:p});var r=CryptoJS.enc.Hex.parse(w.toString());var u=CryptoJS.enc.Base64.stringify(r);return u};var i={"AES-256-CBC":{proc:d,eproc:l,keylen:32,ivlen:16},"AES-192-CBC":{proc:d,eproc:l,keylen:24,ivlen:16},"AES-128-CBC":{proc:d,eproc:l,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:e,eproc:o,keylen:24,ivlen:8},"DES-CBC":{proc:a,eproc:f,keylen:8,ivlen:8}};var c=function(p){return i[p]["proc"]};var m=function(p){var r=CryptoJS.lib.WordArray.random(p);var q=CryptoJS.enc.Hex.stringify(r);return q};var n=function(v){var w={};var q=v.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));if(q){w.cipher=q[1];w.ivsalt=q[2]}var p=v.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));if(p){w.type=p[1]}var u=-1;var x=0;if(v.indexOf("\r\n\r\n")!=-1){u=v.indexOf("\r\n\r\n");x=2}if(v.indexOf("\n\n")!=-1){u=v.indexOf("\n\n");x=1}var t=v.indexOf("-----END");if(u!=-1&&t!=-1){var r=v.substring(u+x*2,t-x);r=r.replace(/\s+/g,"");w.data=r}return w};var j=function(q,y,p){var v=p.substring(0,16);var t=CryptoJS.enc.Hex.parse(v);var r=CryptoJS.enc.Utf8.parse(y);var u=i[q]["keylen"]+i[q]["ivlen"];var x="";var w=null;for(;;){var s=CryptoJS.algo.MD5.create();if(w!=null){s.update(w)}s.update(r);s.update(t);w=s.finalize();x=x+CryptoJS.enc.Hex.stringify(w);if(x.length>=u*2){break}}var z={};z.keyhex=x.substr(0,i[q]["keylen"]*2);z.ivhex=x.substr(i[q]["keylen"]*2,i[q]["ivlen"]*2);return z};var b=function(p,v,r,w){var s=CryptoJS.enc.Base64.parse(p);var q=CryptoJS.enc.Hex.stringify(s);var u=i[v]["proc"];var t=u(q,r,w);return t};var h=function(p,s,q,u){var r=i[s]["eproc"];var t=r(p,q,u);return t};return{version:"1.0.0",parsePKCS5PEM:function(p){return n(p)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(q,p,r){return j(q,p,r)},decryptKeyB64:function(p,r,q,s){return b(p,r,q,s)},getDecryptedKeyHex:function(y,x){var q=n(y);var t=q.type;var r=q.cipher;var p=q.ivsalt;var s=q.data;var w=j(r,x,p);var v=w.keyhex;var u=b(s,r,v,p);return u},getEncryptedPKCS5PEMFromPrvKeyHex:function(x,s,A,t,r){var p="";if(typeof t=="undefined"||t==null){t="AES-256-CBC"}if(typeof i[t]=="undefined"){throw"KEYUTIL unsupported algorithm: "+t}if(typeof r=="undefined"||r==null){var v=i[t]["ivlen"];var u=m(v);r=u.toUpperCase()}var z=j(t,A,r);var y=z.keyhex;var w=h(s,t,y,r);var q=w.replace(/(.{64})/g,"$1\r\n");var p="-----BEGIN "+x+" PRIVATE KEY-----\r\n";p+="Proc-Type: 4,ENCRYPTED\r\n";p+="DEK-Info: "+t+","+r+"\r\n";p+="\r\n";p+=q;p+="\r\n-----END "+x+" PRIVATE KEY-----\r\n";return p},parseHexOfEncryptedPKCS8:function(y){var B=ASN1HEX;var z=B.getChildIdx;var w=B.getV;var t={};var r=z(y,0);if(r.length!=2){throw"malformed format: SEQUENCE(0).items != 2: "+r.length}t.ciphertext=w(y,r[1]);var A=z(y,r[0]);if(A.length!=2){throw"malformed format: SEQUENCE(0.0).items != 2: "+A.length}if(w(y,A[0])!="2a864886f70d01050d"){throw"this only supports pkcs5PBES2"}var p=z(y,A[1]);if(A.length!=2){throw"malformed format: SEQUENCE(0.0.1).items != 2: "+p.length}var q=z(y,p[1]);if(q.length!=2){throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+q.length}if(w(y,q[0])!="2a864886f70d0307"){throw"this only supports TripleDES"}t.encryptionSchemeAlg="TripleDES";t.encryptionSchemeIV=w(y,q[1]);var s=z(y,p[0]);if(s.length!=2){throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+s.length}if(w(y,s[0])!="2a864886f70d01050c"){throw"this only supports pkcs5PBKDF2"}var x=z(y,s[1]);if(x.length<2){throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+x.length}t.pbkdf2Salt=w(y,x[0]);var u=w(y,x[1]);try{t.pbkdf2Iter=parseInt(u,16)}catch(v){throw"malformed format pbkdf2Iter: "+u}return t},getPBKDF2KeyHexFromParam:function(u,p){var t=CryptoJS.enc.Hex.parse(u.pbkdf2Salt);var q=u.pbkdf2Iter;var s=CryptoJS.PBKDF2(p,t,{keySize:192/32,iterations:q});var r=CryptoJS.enc.Hex.stringify(s);return r},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(x,y){var r=pemtohex(x,"ENCRYPTED PRIVATE KEY");var p=this.parseHexOfEncryptedPKCS8(r);var u=KEYUTIL.getPBKDF2KeyHexFromParam(p,y);var v={};v.ciphertext=CryptoJS.enc.Hex.parse(p.ciphertext);var t=CryptoJS.enc.Hex.parse(u);var s=CryptoJS.enc.Hex.parse(p.encryptionSchemeIV);var w=CryptoJS.TripleDES.decrypt(v,t,{iv:s});var q=CryptoJS.enc.Hex.stringify(w);return q},getKeyFromEncryptedPKCS8PEM:function(s,q){var p=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(s,q);var r=this.getKeyFromPlainPrivatePKCS8Hex(p);return r},parsePlainPrivatePKCS8Hex:function(s){var v=ASN1HEX;var u=v.getChildIdx;var t=v.getV;var q={};q.algparam=null;if(s.substr(0,2)!="30"){throw"malformed plain PKCS8 private key(code:001)"}var r=u(s,0);if(r.length!=3){throw"malformed plain PKCS8 private key(code:002)"}if(s.substr(r[1],2)!="30"){throw"malformed PKCS8 private key(code:003)"}var p=u(s,r[1]);if(p.length!=2){throw"malformed PKCS8 private key(code:004)"}if(s.substr(p[0],2)!="06"){throw"malformed PKCS8 private key(code:005)"}q.algoid=t(s,p[0]);if(s.substr(p[1],2)=="06"){q.algparam=t(s,p[1])}if(s.substr(r[2],2)!="04"){throw"malformed PKCS8 private key(code:006)"}q.keyidx=v.getVidx(s,r[2]);return q},getKeyFromPlainPrivatePKCS8PEM:function(q){var p=pemtohex(q,"PRIVATE KEY");var r=this.getKeyFromPlainPrivatePKCS8Hex(p);return r},getKeyFromPlainPrivatePKCS8Hex:function(p){var q=this.parsePlainPrivatePKCS8Hex(p);var r;if(q.algoid=="2a864886f70d010101"){r=new RSAKey()}else{if(q.algoid=="2a8648ce380401"){r=new KJUR.crypto.DSA()}else{if(q.algoid=="2a8648ce3d0201"){r=new KJUR.crypto.ECDSA()}else{throw"unsupported private key algorithm"}}}r.readPKCS8PrvKeyHex(p);return r},_getKeyFromPublicPKCS8Hex:function(q){var p;var r=ASN1HEX.getVbyList(q,0,[0,0],"06");if(r==="2a864886f70d010101"){p=new RSAKey()}else{if(r==="2a8648ce380401"){p=new KJUR.crypto.DSA()}else{if(r==="2a8648ce3d0201"){p=new KJUR.crypto.ECDSA()}else{throw"unsupported PKCS#8 public key hex"}}}p.readPKCS8PubKeyHex(q);return p},parsePublicRawRSAKeyHex:function(r){var u=ASN1HEX;var t=u.getChildIdx;var s=u.getV;var p={};if(r.substr(0,2)!="30"){throw"malformed RSA key(code:001)"}var q=t(r,0);if(q.length!=2){throw"malformed RSA key(code:002)"}if(r.substr(q[0],2)!="02"){throw"malformed RSA key(code:003)"}p.n=s(r,q[0]);if(r.substr(q[1],2)!="02"){throw"malformed RSA key(code:004)"}p.e=s(r,q[1]);return p},parsePublicPKCS8Hex:function(t){var v=ASN1HEX;var u=v.getChildIdx;var s=v.getV;var q={};q.algparam=null;var r=u(t,0);if(r.length!=2){throw"outer DERSequence shall have 2 elements: "+r.length}var w=r[0];if(t.substr(w,2)!="30"){throw"malformed PKCS8 public key(code:001)"}var p=u(t,w);if(p.length!=2){throw"malformed PKCS8 public key(code:002)"}if(t.substr(p[0],2)!="06"){throw"malformed PKCS8 public key(code:003)"}q.algoid=s(t,p[0]);if(t.substr(p[1],2)=="06"){q.algparam=s(t,p[1])}else{if(t.substr(p[1],2)=="30"){q.algparam={};q.algparam.p=v.getVbyList(t,p[1],[0],"02");q.algparam.q=v.getVbyList(t,p[1],[1],"02");q.algparam.g=v.getVbyList(t,p[1],[2],"02")}}if(t.substr(r[1],2)!="03"){throw"malformed PKCS8 public key(code:004)"}q.key=s(t,r[1]).substr(2);return q},}}();KEYUTIL.getKey=function(l,k,n){var G=ASN1HEX,L=G.getChildIdx,v=G.getV,d=G.getVbyList,c=KJUR.crypto,i=c.ECDSA,C=c.DSA,w=RSAKey,M=pemtohex,F=KEYUTIL;if(typeof w!="undefined"&&l instanceof w){return l}if(typeof i!="undefined"&&l instanceof i){return l}if(typeof C!="undefined"&&l instanceof C){return l}if(l.curve!==undefined&&l.xy!==undefined&&l.d===undefined){return new i({pub:l.xy,curve:l.curve})}if(l.curve!==undefined&&l.d!==undefined){return new i({prv:l.d,curve:l.curve})}if(l.kty===undefined&&l.n!==undefined&&l.e!==undefined&&l.d===undefined){var P=new w();P.setPublic(l.n,l.e);return P}if(l.kty===undefined&&l.n!==undefined&&l.e!==undefined&&l.d!==undefined&&l.p!==undefined&&l.q!==undefined&&l.dp!==undefined&&l.dq!==undefined&&l.co!==undefined&&l.qi===undefined){var P=new w();P.setPrivateEx(l.n,l.e,l.d,l.p,l.q,l.dp,l.dq,l.co);return P}if(l.kty===undefined&&l.n!==undefined&&l.e!==undefined&&l.d!==undefined&&l.p===undefined){var P=new w();P.setPrivate(l.n,l.e,l.d);return P}if(l.p!==undefined&&l.q!==undefined&&l.g!==undefined&&l.y!==undefined&&l.x===undefined){var P=new C();P.setPublic(l.p,l.q,l.g,l.y);return P}if(l.p!==undefined&&l.q!==undefined&&l.g!==undefined&&l.y!==undefined&&l.x!==undefined){var P=new C();P.setPrivate(l.p,l.q,l.g,l.y,l.x);return P}if(l.kty==="RSA"&&l.n!==undefined&&l.e!==undefined&&l.d===undefined){var P=new w();P.setPublic(b64utohex(l.n),b64utohex(l.e));return P}if(l.kty==="RSA"&&l.n!==undefined&&l.e!==undefined&&l.d!==undefined&&l.p!==undefined&&l.q!==undefined&&l.dp!==undefined&&l.dq!==undefined&&l.qi!==undefined){var P=new w();P.setPrivateEx(b64utohex(l.n),b64utohex(l.e),b64utohex(l.d),b64utohex(l.p),b64utohex(l.q),b64utohex(l.dp),b64utohex(l.dq),b64utohex(l.qi));return P}if(l.kty==="RSA"&&l.n!==undefined&&l.e!==undefined&&l.d!==undefined){var P=new w();P.setPrivate(b64utohex(l.n),b64utohex(l.e),b64utohex(l.d));return P}if(l.kty==="EC"&&l.crv!==undefined&&l.x!==undefined&&l.y!==undefined&&l.d===undefined){var j=new i({curve:l.crv});var t=j.ecparams.keylen/4;var B=("0000000000"+b64utohex(l.x)).slice(-t);var z=("0000000000"+b64utohex(l.y)).slice(-t);var u="04"+B+z;j.setPublicKeyHex(u);return j}if(l.kty==="EC"&&l.crv!==undefined&&l.x!==undefined&&l.y!==undefined&&l.d!==undefined){var j=new i({curve:l.crv});var t=j.ecparams.keylen/4;var B=("0000000000"+b64utohex(l.x)).slice(-t);var z=("0000000000"+b64utohex(l.y)).slice(-t);var u="04"+B+z;var b=("0000000000"+b64utohex(l.d)).slice(-t);j.setPublicKeyHex(u);j.setPrivateKeyHex(b);return j}if(n==="pkcs5prv"){var J=l,G=ASN1HEX,N,P;N=L(J,0);if(N.length===9){P=new w();P.readPKCS5PrvKeyHex(J)}else{if(N.length===6){P=new C();P.readPKCS5PrvKeyHex(J)}else{if(N.length>2&&J.substr(N[1],2)==="04"){P=new i();P.readPKCS5PrvKeyHex(J)}else{throw"unsupported PKCS#1/5 hexadecimal key"}}}return P}if(n==="pkcs8prv"){var P=F.getKeyFromPlainPrivatePKCS8Hex(l);return P}if(n==="pkcs8pub"){return F._getKeyFromPublicPKCS8Hex(l)}if(n==="x509pub"){return X509.getPublicKeyFromCertHex(l)}if(l.indexOf("-END CERTIFICATE-",0)!=-1||l.indexOf("-END X509 CERTIFICATE-",0)!=-1||l.indexOf("-END TRUSTED CERTIFICATE-",0)!=-1){return X509.getPublicKeyFromCertPEM(l)}if(l.indexOf("-END PUBLIC KEY-")!=-1){var O=pemtohex(l,"PUBLIC KEY");return F._getKeyFromPublicPKCS8Hex(O)}if(l.indexOf("-END RSA PRIVATE KEY-")!=-1&&l.indexOf("4,ENCRYPTED")==-1){var m=M(l,"RSA PRIVATE KEY");return F.getKey(m,null,"pkcs5prv")}if(l.indexOf("-END DSA PRIVATE KEY-")!=-1&&l.indexOf("4,ENCRYPTED")==-1){var I=M(l,"DSA PRIVATE KEY");var E=d(I,0,[1],"02");var D=d(I,0,[2],"02");var K=d(I,0,[3],"02");var r=d(I,0,[4],"02");var s=d(I,0,[5],"02");var P=new C();P.setPrivate(new BigInteger(E,16),new BigInteger(D,16),new BigInteger(K,16),new BigInteger(r,16),new BigInteger(s,16));return P}if(l.indexOf("-END EC PRIVATE KEY-")!=-1&&l.indexOf("4,ENCRYPTED")==-1){var m=M(l,"EC PRIVATE KEY");return F.getKey(m,null,"pkcs5prv")}if(l.indexOf("-END PRIVATE KEY-")!=-1){return F.getKeyFromPlainPrivatePKCS8PEM(l)}if(l.indexOf("-END RSA PRIVATE KEY-")!=-1&&l.indexOf("4,ENCRYPTED")!=-1){var o=F.getDecryptedKeyHex(l,k);var H=new RSAKey();H.readPKCS5PrvKeyHex(o);return H}if(l.indexOf("-END EC PRIVATE KEY-")!=-1&&l.indexOf("4,ENCRYPTED")!=-1){var I=F.getDecryptedKeyHex(l,k);var P=d(I,0,[1],"04");var f=d(I,0,[2,0],"06");var A=d(I,0,[3,0],"03").substr(2);var e="";if(KJUR.crypto.OID.oidhex2name[f]!==undefined){e=KJUR.crypto.OID.oidhex2name[f]}else{throw"undefined OID(hex) in KJUR.crypto.OID: "+f}var j=new i({curve:e});j.setPublicKeyHex(A);j.setPrivateKeyHex(P);j.isPublic=false;return j}if(l.indexOf("-END DSA PRIVATE KEY-")!=-1&&l.indexOf("4,ENCRYPTED")!=-1){var I=F.getDecryptedKeyHex(l,k);var E=d(I,0,[1],"02");var D=d(I,0,[2],"02");var K=d(I,0,[3],"02");var r=d(I,0,[4],"02");var s=d(I,0,[5],"02");var P=new C();P.setPrivate(new BigInteger(E,16),new BigInteger(D,16),new BigInteger(K,16),new BigInteger(r,16),new BigInteger(s,16));return P}if(l.indexOf("-END ENCRYPTED PRIVATE KEY-")!=-1){return F.getKeyFromEncryptedPKCS8PEM(l,k)}throw"not supported argument"};KEYUTIL.generateKeypair=function(a,c){if(a=="RSA"){var b=c;var h=new RSAKey();h.generate(b,"10001");h.isPrivate=true;h.isPublic=true;var f=new RSAKey();var e=h.n.toString(16);var i=h.e.toString(16);f.setPublic(e,i);f.isPrivate=false;f.isPublic=true;var k={};k.prvKeyObj=h;k.pubKeyObj=f;return k}else{if(a=="EC"){var d=c;var g=new KJUR.crypto.ECDSA({curve:d});var j=g.generateKeyPairHex();var h=new KJUR.crypto.ECDSA({curve:d});h.setPublicKeyHex(j.ecpubhex);h.setPrivateKeyHex(j.ecprvhex);h.isPrivate=true;h.isPublic=false;var f=new KJUR.crypto.ECDSA({curve:d});f.setPublicKeyHex(j.ecpubhex);f.isPrivate=false;f.isPublic=true;var k={};k.prvKeyObj=h;k.pubKeyObj=f;return k}else{throw"unknown algorithm: "+a}}};KEYUTIL.getPEM=function(b,D,y,m,q,j){var F=KJUR,k=F.asn1,z=k.DERObjectIdentifier,f=k.DERInteger,l=k.ASN1Util.newObject,a=k.x509,C=a.SubjectPublicKeyInfo,e=F.crypto,u=e.DSA,r=e.ECDSA,n=RSAKey;function A(s){var G=l({seq:[{"int":0},{"int":{bigint:s.n}},{"int":s.e},{"int":{bigint:s.d}},{"int":{bigint:s.p}},{"int":{bigint:s.q}},{"int":{bigint:s.dmp1}},{"int":{bigint:s.dmq1}},{"int":{bigint:s.coeff}}]});return G}function B(G){var s=l({seq:[{"int":1},{octstr:{hex:G.prvKeyHex}},{tag:["a0",true,{oid:{name:G.curveName}}]},{tag:["a1",true,{bitstr:{hex:"00"+G.pubKeyHex}}]}]});return s}function x(s){var G=l({seq:[{"int":0},{"int":{bigint:s.p}},{"int":{bigint:s.q}},{"int":{bigint:s.g}},{"int":{bigint:s.y}},{"int":{bigint:s.x}}]});return G}if(((n!==undefined&&b instanceof n)||(u!==undefined&&b instanceof u)||(r!==undefined&&b instanceof r))&&b.isPublic==true&&(D===undefined||D=="PKCS8PUB")){var E=new C(b);var w=E.getEncodedHex();return hextopem(w,"PUBLIC KEY")}if(D=="PKCS1PRV"&&n!==undefined&&b instanceof n&&(y===undefined||y==null)&&b.isPrivate==true){var E=A(b);var w=E.getEncodedHex();return hextopem(w,"RSA PRIVATE KEY")}if(D=="PKCS1PRV"&&r!==undefined&&b instanceof r&&(y===undefined||y==null)&&b.isPrivate==true){var i=new z({name:b.curveName});var v=i.getEncodedHex();var h=B(b);var t=h.getEncodedHex();var p="";p+=hextopem(v,"EC PARAMETERS");p+=hextopem(t,"EC PRIVATE KEY");return p}if(D=="PKCS1PRV"&&u!==undefined&&b instanceof u&&(y===undefined||y==null)&&b.isPrivate==true){var E=x(b);var w=E.getEncodedHex();return hextopem(w,"DSA PRIVATE KEY")}if(D=="PKCS5PRV"&&n!==undefined&&b instanceof n&&(y!==undefined&&y!=null)&&b.isPrivate==true){var E=A(b);var w=E.getEncodedHex();if(m===undefined){m="DES-EDE3-CBC"}return this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",w,y,m,j)}if(D=="PKCS5PRV"&&r!==undefined&&b instanceof r&&(y!==undefined&&y!=null)&&b.isPrivate==true){var E=B(b);var w=E.getEncodedHex();if(m===undefined){m="DES-EDE3-CBC"}return this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",w,y,m,j)}if(D=="PKCS5PRV"&&u!==undefined&&b instanceof u&&(y!==undefined&&y!=null)&&b.isPrivate==true){var E=x(b);var w=E.getEncodedHex();if(m===undefined){m="DES-EDE3-CBC"}return this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",w,y,m,j)}var o=function(G,s){var I=c(G,s);var H=new l({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:I.pbkdf2Salt}},{"int":I.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:I.encryptionSchemeIV}}]}]}]},{octstr:{hex:I.ciphertext}}]});return H.getEncodedHex()};var c=function(N,O){var H=100;var M=CryptoJS.lib.WordArray.random(8);var L="DES-EDE3-CBC";var s=CryptoJS.lib.WordArray.random(8);var I=CryptoJS.PBKDF2(O,M,{keySize:192/32,iterations:H});var J=CryptoJS.enc.Hex.parse(N);var K=CryptoJS.TripleDES.encrypt(J,I,{iv:s})+"";var G={};G.ciphertext=K;G.pbkdf2Salt=CryptoJS.enc.Hex.stringify(M);G.pbkdf2Iter=H;G.encryptionSchemeAlg=L;G.encryptionSchemeIV=CryptoJS.enc.Hex.stringify(s);return G};if(D=="PKCS8PRV"&&n!=undefined&&b instanceof n&&b.isPrivate==true){var g=A(b);var d=g.getEncodedHex();var E=l({seq:[{"int":0},{seq:[{oid:{name:"rsaEncryption"}},{"null":true}]},{octstr:{hex:d}}]});var w=E.getEncodedHex();if(y===undefined||y==null){return hextopem(w,"PRIVATE KEY")}else{var t=o(w,y);return hextopem(t,"ENCRYPTED PRIVATE KEY")}}if(D=="PKCS8PRV"&&r!==undefined&&b instanceof r&&b.isPrivate==true){var g=new l({seq:[{"int":1},{octstr:{hex:b.prvKeyHex}},{tag:["a1",true,{bitstr:{hex:"00"+b.pubKeyHex}}]}]});var d=g.getEncodedHex();var E=l({seq:[{"int":0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:b.curveName}}]},{octstr:{hex:d}}]});var w=E.getEncodedHex();if(y===undefined||y==null){return hextopem(w,"PRIVATE KEY")}else{var t=o(w,y);return hextopem(t,"ENCRYPTED PRIVATE KEY")}}if(D=="PKCS8PRV"&&u!==undefined&&b instanceof u&&b.isPrivate==true){var g=new f({bigint:b.x});var d=g.getEncodedHex();var E=l({seq:[{"int":0},{seq:[{oid:{name:"dsa"}},{seq:[{"int":{bigint:b.p}},{"int":{bigint:b.q}},{"int":{bigint:b.g}}]}]},{octstr:{hex:d}}]});var w=E.getEncodedHex();if(y===undefined||y==null){return hextopem(w,"PRIVATE KEY")}else{var t=o(w,y);return hextopem(t,"ENCRYPTED PRIVATE KEY")}}throw"unsupported object nor format"};KEYUTIL.getKeyFromCSRPEM=function(b){var a=pemtohex(b,"CERTIFICATE REQUEST");var c=KEYUTIL.getKeyFromCSRHex(a);return c};KEYUTIL.getKeyFromCSRHex=function(a){var c=KEYUTIL.parseCSRHex(a);var b=KEYUTIL.getKey(c.p8pubkeyhex,null,"pkcs8pub");return b};KEYUTIL.parseCSRHex=function(d){var i=ASN1HEX;var f=i.getChildIdx;var c=i.getTLV;var b={};var g=d;if(g.substr(0,2)!="30"){throw"malformed CSR(code:001)"}var e=f(g,0);if(e.length<1){throw"malformed CSR(code:002)"}if(g.substr(e[0],2)!="30"){throw"malformed CSR(code:003)"}var a=f(g,e[0]);if(a.length<3){throw"malformed CSR(code:004)"}b.p8pubkeyhex=c(g,a[2]);return b};KEYUTIL.getKeyID=function(f){var c=KEYUTIL;var e=ASN1HEX;if(typeof f==="string"&&f.indexOf("BEGIN ")!=-1){f=c.getKey(f)}var d=pemtohex(c.getPEM(f));var b=e.getIdxbyList(d,0,[1]);var a=e.getV(d,b).substring(2);return KJUR.crypto.Util.hashHex(a,"sha1")};KEYUTIL.getJWKFromKey=function(d){var b={};if(d instanceof RSAKey&&d.isPrivate){b.kty="RSA";b.n=hextob64u(d.n.toString(16));b.e=hextob64u(d.e.toString(16));b.d=hextob64u(d.d.toString(16));b.p=hextob64u(d.p.toString(16));b.q=hextob64u(d.q.toString(16));b.dp=hextob64u(d.dmp1.toString(16));b.dq=hextob64u(d.dmq1.toString(16));b.qi=hextob64u(d.coeff.toString(16));return b}else{if(d instanceof RSAKey&&d.isPublic){b.kty="RSA";b.n=hextob64u(d.n.toString(16));b.e=hextob64u(d.e.toString(16));return b}else{if(d instanceof KJUR.crypto.ECDSA&&d.isPrivate){var a=d.getShortNISTPCurveName();if(a!=="P-256"&&a!=="P-384"){throw"unsupported curve name for JWT: "+a}var c=d.getPublicKeyXYHex();b.kty="EC";b.crv=a;b.x=hextob64u(c.x);b.y=hextob64u(c.y);b.d=hextob64u(d.prvKeyHex);return b}else{if(d instanceof KJUR.crypto.ECDSA&&d.isPublic){var a=d.getShortNISTPCurveName();if(a!=="P-256"&&a!=="P-384"){throw"unsupported curve name for JWT: "+a}var c=d.getPublicKeyXYHex();b.kty="EC";b.crv=a;b.x=hextob64u(c.x);b.y=hextob64u(c.y);return b}}}}throw"not supported key object"}; RSAKey.getPosArrayOfChildrenFromHex=function(a){return ASN1HEX.getChildIdx(a,0)};RSAKey.getHexValueArrayOfChildrenFromHex=function(f){var n=ASN1HEX;var i=n.getV;var k=RSAKey.getPosArrayOfChildrenFromHex(f);var e=i(f,k[0]);var j=i(f,k[1]);var b=i(f,k[2]);var c=i(f,k[3]);var h=i(f,k[4]);var g=i(f,k[5]);var m=i(f,k[6]);var l=i(f,k[7]);var d=i(f,k[8]);var k=new Array();k.push(e,j,b,c,h,g,m,l,d);return k};RSAKey.prototype.readPrivateKeyFromPEMString=function(d){var c=pemtohex(d);var b=RSAKey.getHexValueArrayOfChildrenFromHex(c);this.setPrivateEx(b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8])};RSAKey.prototype.readPKCS5PrvKeyHex=function(c){var b=RSAKey.getHexValueArrayOfChildrenFromHex(c);this.setPrivateEx(b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8])};RSAKey.prototype.readPKCS8PrvKeyHex=function(e){var c,j,l,b,a,f,d,k;var m=ASN1HEX;var g=m.getVbyList;if(m.isASN1HEX(e)===false){throw"not ASN.1 hex string"}try{c=g(e,0,[2,0,1],"02");j=g(e,0,[2,0,2],"02");l=g(e,0,[2,0,3],"02");b=g(e,0,[2,0,4],"02");a=g(e,0,[2,0,5],"02");f=g(e,0,[2,0,6],"02");d=g(e,0,[2,0,7],"02");k=g(e,0,[2,0,8],"02")}catch(i){throw"malformed PKCS#8 plain RSA private key"}this.setPrivateEx(c,j,l,b,a,f,d,k)};RSAKey.prototype.readPKCS5PubKeyHex=function(c){var e=ASN1HEX;var b=e.getV;if(e.isASN1HEX(c)===false){throw"keyHex is not ASN.1 hex string"}var a=e.getChildIdx(c,0);if(a.length!==2||c.substr(a[0],2)!=="02"||c.substr(a[1],2)!=="02"){throw"wrong hex for PKCS#5 public key"}var f=b(c,a[0]);var d=b(c,a[1]);this.setPublic(f,d)};RSAKey.prototype.readPKCS8PubKeyHex=function(b){var c=ASN1HEX;if(c.isASN1HEX(b)===false){throw"not ASN.1 hex string"}if(c.getTLVbyList(b,0,[0,0])!=="06092a864886f70d010101"){throw"not PKCS8 RSA public key"}var a=c.getTLVbyList(b,0,[1,0]);this.readPKCS5PubKeyHex(a)};RSAKey.prototype.readCertPubKeyHex=function(b,d){var a,c;a=new X509();a.readCertHex(b);c=a.getPublicKeyHex();this.readPKCS8PubKeyHex(c)}; var _RE_HEXDECONLY=new RegExp("[^0-9a-f]","gi");function _rsasign_getHexPaddedDigestInfoForString(d,e,a){var b=function(f){return KJUR.crypto.Util.hashString(f,a)};var c=b(d);return KJUR.crypto.Util.getPaddedDigestInfoHex(c,a,e)}function _zeroPaddingOfSignature(e,d){var c="";var a=d/4-e.length;for(var b=0;b>24,(d&16711680)>>16,(d&65280)>>8,d&255]))));d+=1}return b}RSAKey.prototype.signPSS=function(e,a,d){var c=function(f){return KJUR.crypto.Util.hashHex(f,a)};var b=c(rstrtohex(e));if(d===undefined){d=-1}return this.signWithMessageHashPSS(b,a,d)};RSAKey.prototype.signWithMessageHashPSS=function(l,a,k){var b=hextorstr(l);var g=b.length;var m=this.n.bitLength()-1;var c=Math.ceil(m/8);var d;var o=function(i){return KJUR.crypto.Util.hashHex(i,a)};if(k===-1||k===undefined){k=g}else{if(k===-2){k=c-g-2}else{if(k<-2){throw"invalid salt length"}}}if(c<(g+k+2)){throw"data too long"}var f="";if(k>0){f=new Array(k);new SecureRandom().nextBytes(f);f=String.fromCharCode.apply(String,f)}var n=hextorstr(o(rstrtohex("\x00\x00\x00\x00\x00\x00\x00\x00"+b+f)));var j=[];for(d=0;d>(8*c-m))&255;q[0]&=~p;for(d=0;dthis.n.bitLength()){return 0}var i=this.doPublic(b);var e=i.toString(16).replace(/^1f+00/,"");var g=_rsasign_getAlgNameAndHashFromHexDisgestInfo(e);if(g.length==0){return false}var d=g[0];var h=g[1];var a=function(k){return KJUR.crypto.Util.hashString(k,d)};var c=a(f);return(h==c)};RSAKey.prototype.verifyWithMessageHash=function(e,a){if(a.length!=Math.ceil(this.n.bitLength()/4)){return false}var b=parseBigInt(a,16);if(b.bitLength()>this.n.bitLength()){return 0}var h=this.doPublic(b);var g=h.toString(16).replace(/^1f+00/,"");var c=_rsasign_getAlgNameAndHashFromHexDisgestInfo(g);if(c.length==0){return false}var d=c[0];var f=c[1];return(f==e)};RSAKey.prototype.verifyPSS=function(c,b,a,f){var e=function(g){return KJUR.crypto.Util.hashHex(g,a)};var d=e(rstrtohex(c));if(f===undefined){f=-1}return this.verifyWithMessageHashPSS(d,b,a,f)};RSAKey.prototype.verifyWithMessageHashPSS=function(f,s,l,c){if(s.length!=Math.ceil(this.n.bitLength()/4)){return false}var k=new BigInteger(s,16);var r=function(i){return KJUR.crypto.Util.hashHex(i,l)};var j=hextorstr(f);var h=j.length;var g=this.n.bitLength()-1;var m=Math.ceil(g/8);var q;if(c===-1||c===undefined){c=h}else{if(c===-2){c=m-h-2}else{if(c<-2){throw"invalid salt length"}}}if(m<(h+c+2)){throw"data too long"}var a=this.doPublic(k).toByteArray();for(q=0;q>(8*m-g))&255;if((d.charCodeAt(0)&p)!==0){throw"bits beyond keysize not zero"}var n=pss_mgf1_str(e,d.length,r);var o=[];for(q=0;q0){var b=":"+n.join(":")+":";if(b.indexOf(":"+k+":")==-1){throw"algorithm '"+k+"' not accepted in the list"}}if(k!="none"&&B===null){throw"key shall be specified to verify."}if(typeof B=="string"&&B.indexOf("-----BEGIN ")!=-1){B=KEYUTIL.getKey(B)}if(z=="RS"||z=="PS"){if(!(B instanceof m)){throw"key shall be a RSAKey obj for RS* and PS* algs"}}if(z=="ES"){if(!(B instanceof p)){throw"key shall be a ECDSA obj for ES* algs"}}if(k=="none"){}var u=null;if(t.jwsalg2sigalg[l.alg]===undefined){throw"unsupported alg name: "+k}else{u=t.jwsalg2sigalg[k]}if(u=="none"){throw"not supported"}else{if(u.substr(0,4)=="Hmac"){var o=null;if(B===undefined){throw"hexadecimal key shall be specified for HMAC"}var j=new s({alg:u,pass:B});j.updateString(c);o=j.doFinal();return A==o}else{if(u.indexOf("withECDSA")!=-1){var h=null;try{h=p.concatSigToASN1Sig(A)}catch(v){return false}var g=new d({alg:u});g.init(B);g.updateString(c);return g.verify(h)}else{var g=new d({alg:u});g.init(B);g.updateString(c);return g.verify(A)}}}};KJUR.jws.JWS.parse=function(g){var c=g.split(".");var b={};var f,e,d;if(c.length!=2&&c.length!=3){throw"malformed sJWS: wrong number of '.' splitted elements"}f=c[0];e=c[1];if(c.length==3){d=c[2]}b.headerObj=KJUR.jws.JWS.readSafeJSONString(b64utoutf8(f));b.payloadObj=KJUR.jws.JWS.readSafeJSONString(b64utoutf8(e));b.headerPP=JSON.stringify(b.headerObj,null," ");if(b.payloadObj==null){b.payloadPP=b64utoutf8(e)}else{b.payloadPP=JSON.stringify(b.payloadObj,null," ")}if(d!==undefined){b.sigHex=b64utohex(d)}return b};KJUR.jws.JWS.verifyJWT=function(e,l,r){var d=KJUR,j=d.jws,o=j.JWS,n=o.readSafeJSONString,p=o.inArray,f=o.includedArray;var k=e.split(".");var c=k[0];var i=k[1];var q=c+"."+i;var m=b64utohex(k[2]);var h=n(b64utoutf8(c));var g=n(b64utoutf8(i));if(h.alg===undefined){return false}if(r.alg===undefined){throw"acceptField.alg shall be specified"}if(!p(h.alg,r.alg)){return false}if(g.iss!==undefined&&typeof r.iss==="object"){if(!p(g.iss,r.iss)){return false}}if(g.sub!==undefined&&typeof r.sub==="object"){if(!p(g.sub,r.sub)){return false}}if(g.aud!==undefined&&typeof r.aud==="object"){if(typeof g.aud=="string"){if(!p(g.aud,r.aud)){return false}}else{if(typeof g.aud=="object"){if(!f(g.aud,r.aud)){return false}}}}var b=j.IntDate.getNow();if(r.verifyAt!==undefined&&typeof r.verifyAt==="number"){b=r.verifyAt}if(r.gracePeriod===undefined||typeof r.gracePeriod!=="number"){r.gracePeriod=0}if(g.exp!==undefined&&typeof g.exp=="number"){if(g.exp+r.gracePeriodl){this.aHeader.pop()}if(this.aSignature.length>l){this.aSignature.pop()}throw"addSignature failed: "+i}};this.verifyAll=function(h){if(this.aHeader.length!==h.length||this.aSignature.length!==h.length){return false}for(var g=0;g0){this.aHeader=g.headers}else{throw"malformed header"}if(typeof g.payload==="string"){this.sPayload=g.payload}else{throw"malformed signatures"}if(g.signatures.length>0){this.aSignature=g.signatures}else{throw"malformed signatures"}}catch(e){throw"malformed JWS-JS JSON object: "+e}}};this.getJSON=function(){return{headers:this.aHeader,payload:this.sPayload,signatures:this.aSignature}};this.isEmpty=function(){if(this.aHeader.length==0){return 1}return 0}}; } catch(e){ console.log(e) } }catch(e){console.log(e);}} if(!utag_condload){try{ try{ /** * version 3.0.3 * @module extensions/preloader/scripts/onetrustCcpa * @author adrienne.rice@bofa.com * @author luis.perezrivas@bofa.com * @author armon.roberts@bofa.com */ (() => { // do not load one trust in chat pages if(window.location.href.includes('/chat/')) return const style = document.createElement('style'); style.setAttribute('id', 'onetrust-style'); style.setAttribute('nonce', 'onetrust-style'); try { document.head.appendChild(style); } catch { console.log('Could not create style element: ', e); } const oneTrustDomains = window.vtimConfigs?.oneTrust?.oneTrustDomainConfig ?? []; const blockedDomains = window.vtimConfigs?.oneTrust?.blockedList ?? []; const oneTrustPages = window.vtimConfigs?.oneTrust?.OneTrustPageSpecificConfig ?? []; const CAADCAPages = window.vtimConfigs?.oneTrust?.CAADCAPages ?? []; function getCookie(name) { const cookies = document.cookie; const parts = cookies.split(name + '='); if (parts.length === 2) return parts.pop().split(';').shift().split('|').shift(); return false; } const doesPFlagExist = !!getCookie('privacyFlag'); /** privacyFlag for CAADCA support * privacyFlag = 000000 (adult) * privacyFlag = 100000 (minor) */ window.isMinor = ( ()=> { if (doesPFlagExist) { return parseInt(getCookie('privacyFlag')[0]); } })(); // constructing clean url to compare against caadca pages array const isCAADCAPage = ( ()=> { const cleanUrl = window.location.protocol + '//' + window.location.host + window.location.pathname; return CAADCAPages.filter(item => cleanUrl === item.domain) })(); window.inScope = Boolean(isCAADCAPage.length > 0); let privacyId = (() => { const mmid = getCookie('MMID'); if (mmid) { return mmid; } else { return null; } })(); if (privacyId && window.KJUR.jws) { try { let jwtHeader = {alg: 'HS256', typ: 'JWT', kid: 1110 }; let jwtPayload = {}; let tNow = KJUR.jws.IntDate.get('now'); let tEnd = KJUR.jws.IntDate.get('now + 1day'); let tPubKey = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQClEFB3wpgL+dr9Cm38jf3MSvleTdGN6pNBltb/kNTD79qZGbK58iEN2ktkHY0/gCbkkUM0qGV+0AGKz7KWdmUt5JHa5q36R9h+Z+5Bn1QQf92m29wCl0nBiu8m9frbvFVTsQlMU08KNJ1b/EHMSPFPtIPOJq17Y+/NNi7kb/HBxwIDAQAB'; jwtPayload.sub = privacyId; jwtPayload.iat = tNow; jwtPayload.exp = tEnd; let headerString = JSON.stringify(jwtHeader); let payloadString = JSON.stringify(jwtPayload); let sJWT = KJUR.jws.JWS.sign('HS256', headerString, payloadString, tPubKey); window.OneTrust = { dataSubjectParams: { id: privacyId, isAnonymous: false, token: sJWT } }; } catch(e){ console.log(e); } } const loadOtOnDomain = () => { try { const matchingDomain = oneTrustDomains?.map((domainConfig) => domainConfig.domain).includes("https://" + window.location.host) || bactm_envSelector === "notprod"; const willLoadOt = (matchingDomain && !blockedDomains.includes(window.location.host) && !blockedDomains.includes(window.location.href)); window.otEnabled = willLoadOt; return willLoadOt; } catch (e){ console.log(e) } } // check to see if OneTrust footer is present const footerPresent = (Array.from(document.getElementsByClassName('ot-sdk-show-settings')).length > 0) // if not present wait for Global Tenants(gt) to publish event if (!footerPresent) { document.addEventListener( "gt-footer-v6-loaded", () => { if (window.OneTrust?.initializeCookiePolicyHtml) OneTrust.initializeCookiePolicyHtml(); if (window.bactm & window?.bactm?.rescanDOM) bactm.rescanDOM(); }, false ); // if OneTrust footer is on non-gt page, wait 5 seconds and init just in case setTimeout(() => { if (window.OneTrust?.initializeCookiePolicyHtml) OneTrust.initializeCookiePolicyHtml(); }, 5000) }; const determineDomain = () => { try { let filteredDomain = []; let filteredPage = []; filteredPage = oneTrustPages?.filter((page) => (window.location.origin + window.location.pathname).includes(page.domain)); // return filtered page if found. If not, return match from domain list BAU. filteredDomain = filteredPage.length > 0 ? filteredPage : (oneTrustDomains ?.filter((domain) => (window.location.origin + window.location.pathname) .includes(domain.domain))); // if multiple hits, take the longest one that matches, this will be the most specific one. if (filteredDomain.length > 0) filteredDomain = [filteredDomain.reduce((a, b) => {return a.length > b.length ? a : b;})] const otDomain = filteredDomain?.length > 0 ? filteredDomain : window.bactm_envSelector === "notprod" ? [oneTrustDomains[0]] : filteredDomain; if (otDomain?.length === 1) { return { OT_KEY: otDomain[0].domain_id, OT_HASH: otDomain[0].sri_hash, myNonce: 'nonce-64cbb6d74480ebbb919a7a7486752796c41a33359bb7575806718f279b01e8cf' }; } else { if (bactm_envSelector === "notprod"){ console.log('OneTrust unable to load.') console.log('Something went wrong or domain not in list. This Domain is: ', window.location.host) } return {}; } } catch (e){ console.log(e); } }; // event listener for potential CSP Violations document.addEventListener("securitypolicyviolation", (e) => { if (e.violatedDirective === "script-src-elem" && e.blockedURI.includes("cdn.cookielaw.org")) console.log("***************************OneTrust CSP Error******************************\n\nOneTrust is supposed to load on this page, but the Content-Security-Policy header is blocking it. Please include cdn.cookielaw.org in your script-src Content-Security-Policy config. \n \n***************************OneTrust CSP Error******************************"); } ); let { OT_KEY, OT_HASH, myNonce } = determineDomain(); if (loadOtOnDomain()) { /* Temporary solution, delete after Feb 2025 release. After Nov 2024 release, an old OptanonConsent cookie remained for a list of base domains. Need to remove that cookie in order for backend to retrieve the correct identifier in consent receipt. */ const optanonConsentBaseDomains = ['.privatebank.bankofamerica.com', '.bofa.com']; optanonConsentBaseDomains.forEach( (domain) => { document.cookie = 'OptanonConsent=true; path=/; domain='+ domain +'; expires=Wed, 18 Dec 1999 00:00:00 GMT;' }); // OneTrust Script let otLoader = document.createElement('script'); otLoader.setAttribute('type','text/javascript') otLoader.setAttribute('charset','UTF-8') /** E-Privacy/One Trust logic. tealium: set window.isMinor. if true (is a minor), loads OT template with Always Inactive (CADCA will not be present) if false (not a minor), loads OT template w/ toggle visible and enabled (CADCA will be present) tealium: if !privacyFlag, we don't know how old you are. We need to read inScope variable if (inScope), load OT template w/ age gate if (!inScope) load OT template w/ toggle visible and enabled (CADCA will be present) } */ // if array is empty defaults to false const caadcaConfig = isCAADCAPage.length > 0 && isCAADCAPage[0]; if (!doesPFlagExist && caadcaConfig) { otLoader.setAttribute('data-domain-script', caadcaConfig.domain_id ) otLoader.setAttribute('integrity', caadcaConfig.sri_hash ) otLoader.setAttribute('src','https://cdn.cookielaw.org/consent/' + caadcaConfig.domain_id + '/otSDKStub.js') } else { otLoader.setAttribute('data-domain-script', OT_KEY ) otLoader.setAttribute('integrity', OT_HASH ) otLoader.setAttribute('src','https://cdn.cookielaw.org/consent/' + OT_KEY + '/otSDKStub.js') } otLoader.setAttribute('data-document-language','true') otLoader.setAttribute('crossorigin','anonymous') // Following 3 defined at top of script. Logic determines which configs to use based on domain. otLoader.setAttribute('nonce',myNonce) otLoader.setAttribute('data-ostdk', 'VTIM'); try { document.head.appendChild(otLoader); } catch (error) { console.error("Error loading OneTrust Loader" , error); } // OptanonWrapper script -- this is the logic which runs after OneTrust interaction. let otWrapper = document.createElement('script'); otWrapper.setAttribute('function','OptanonWrapper()') otWrapper.setAttribute('nonce',myNonce) try { // Append loader to page. document.head.appendChild(otWrapper); } catch (error) { console.error("Error loading OneTrust Wrapper", error); } } })(); } catch(e){ console.log(e) } }catch(e){console.log(e);}} if(!utag_condload){try{ try{ /** @license Copyright 2016 Bank of America, N.A. All rights reserved. */ /** * @fileoverview Bank of America IBM Digital Analytics data collection library. * * @requires window.digitalData * @requires eluminate.js * @requires cmdatatagutils.js * * This library is used to manage core aspects of the digitalData object and to capture * digital analytics events and send them to Coremetrics. The primary events to capture * are pageview, manual link clicks, custom errors, and application conversion events. * * This library can also be used to maintain an accurate history of the current pageID * for single page application via the digitalData.page.attributes.pageIDHistory array. * * Example #1: * Pageview on the default pageInfo array object. * * bactm.pageview(); * * Example #2: * Pageview on pageInfo object found at array index 5, passing in additonal segments * and selecting to utilize digitalData.page.category.addlCategory as the category. * * bactm.pageview(5, { segments: ['olbc_N', 'st_NC'], categoryType: 'additional' }); * * Example #3: * Application pageview on pageInfo object found at array index 2. * * bactm.pageview(2, { isApp: true }); * * Example #4: * Pageview for pageInfo object that has pageID matching: 'this_is:my:PageID' * * bactm.pageview('this_is:my:PageID'); * OR * bactm.pageview('this_is:my:PageID', { lookupType: 'pageID' }); * * Example #5: * Pageview for pageInfo object that matches the pageID found in the * utag_data.Dynamic_PageView_Element Tealium lookup table, with a matching associated * value of: 'SomeValue' * * bactm.pageview('SomeValue', { lookupType: 'associatedValue' }); * * All event helper functions within this library, will utilize the dataCollector * queue to allow data collection events to being to be collected immediately * and sent to Coremetrics as the queue is processed as soon as the main Coremetrics * libraries are loaded and ready. * * The dataCollector is a shared queue of objects holding generic information * about the event. It uses a queue so that the page can record events before the * main Coremetrics libraries are loaded. * * For example, a page might start with the following dataCollector in its head section: * * window.dataCollector = window.dataCollector || []; * dataCollector.push({ * 'event' : 'pageview', * 'pageInfoArrayIndex' : 1, * 'options' : { * 'isApp' : false * } * }); * * The queue will then be processed and events sent to Coremetrics once the main * Coremetrics libraries are ready. * * @author jeremy.hodges@bankofamerica.com (Jeremy Hodges) */ (function (name, context, definition) { // Check if is used inside a "modern" browser, if not, return if (!context || !Array.prototype.filter) { return; } context[name] = definition(); })('bactm', typeof window !== 'undefined' ? window : null, function () { // Initial variable configurations var win = window , doc = document || {} , version = '3.2.0' , plugins = {} , publishedEvents = {} , queuedEvents = {} , env = win.bactm_envSelector || 'notprod' , utagLoadStopped = false , isDOMReady = false , readyHandlers = [] , loadCoremetrics = false , pageviewOnLoad = typeof digitalData !== 'undefined' && (typeof digitalData.disable_pageviewonload === 'undefined' || digitalData.disable_pageviewonload === null || digitalData.disable_pageviewonload.toString().toLowerCase() !== 'true') , isProd = env === 'prod' ? true : false , cmLibLoadEventName = 'bactm_libload' , attrValueSeperator = '-_-' , segmentWrapperChar = '|' , segmentValueSeperator = segmentWrapperChar + segmentWrapperChar , storageKeyPrefix = 'bactm.' , logQ = [] , _logPageviewToSplunk = { 'homepage:Content:Personal;homepage_personal': true , 'homepage:Content:Personal;homepage_personal_signoff': true } , conversionActionTypes = { 'initiate': 1 , 'complete': 2 } , SITE_PROMOTIONS_INTERVAL = 300 , SITE_PROMOTIONS_THRESHOLD = 3000 , SITE_PROMOTIONS_ACCUMULATOR = 0 , LOG_LEVEL = { OFF: 10 , FATAL: 5 , ERROR: 4 , WARN: 3 , INFO: 2 , DEBUG: 1 } , LOG_LEVEL_STRINGS = { 5: 'trace' , 4: 'error' , 3: 'warn' , 2: 'info' , 1: 'log' } , _settings = { logLevel: isProd ? LOG_LEVEL.OFF : LOG_LEVEL.DEBUG, coremetricsUtagId: 1 } , modals = [ 'Ent:Mkt:Survey;Convergys_open', 'Ent:Mkt:Survey;Convergys_complete', 'MDA:CONTENT:DEALS;INTRODUCING_COINS_MODAL', 'MDA:CONTENT:DEALS;LOCATIONCONSENTMODAL', 'MDA:CONTENT:DEALS;HOW_COINS_WORK_MODAL', 'OLB:CONTENT:ACCTDETAILS:CARD;THREEPERCENTSASIMODALNEW', 'OLB:TOOL:ACCTDETAILS:HEMI;PORTAL_ELECTRONIC_COSENT_CHANGE_DELIVERY_PREFERENCES_MODAL', 'OSP:CONTENT:CONCOM:TOFFERS;CASHCOUPONS_HOW_COINS_WORK_MODAL', 'SMBUS:TOOL:BUSINESSADVANTAGE360;ONBOARDING_MODAL', 'OLB:CONTENT:ACCTDETAILS:CARD;THREEPERCENTSASIMODALEXISTING', 'OLB:TOOL:ACCTDETAILS;EDIT_CATEGORY_MODAL', 'OSP:CONTENT:CONCOM:TOFFERS;CASHCOUPONS_INTRODUCING_COINS_MODAL', 'MDA:CONTENT:DEALS;INTRODUCING_COINS_MODAL_ES', 'OLB:TOOL:FINWELL;EDIT_CATEGORY_MODAL', 'MDA:CONTENT:DEALS;HOW_LEVELS_WORK_MODAL', 'MDA:CONTENT:BILLPAY;SUCCESS_CANCEL_PREV_SCHED_PMNT_MODAL', 'MDA:CONTENT:MYCONTACTINFO;DELETEPHONEMODAL', 'OLB:CONTENT:FINWELL;CREATE_NEW_GOAL_MODAL', 'GWM:MKT:MERRILLEDGE;ACCOUNT-SELECTOR-MODAL-MOBILE', 'MDA:CONTENT:DEALS;ALLOWLOCATIONMODAL', 'OLB:TOOL:ACCTDETAILS:HEMI;PORTAL_ESIGN_MODAL', 'MDA:CONTENT:DEALS;LOCATIONCONSENTMODAL_ES', 'GWM:MKT:MERRILLEDGE;ACCOUNT-SELECTOR-MODAL-DESKTOP', 'OLB:CONTENT:CUSTSVC:HEMI;LATECHARGE_MODAL', 'OLB:TOOL:ACCTDETAILS:HEMI;PORTAL_MESSAGES_MODAL', 'OLB:CONTENT:FINWELL;SET_BUDGET_MODAL', 'DEP:APP:CDP;CDP:800:TIMEOUT_MODAL', 'CARDS:APP:SP;CARD_SP_EC:800:TIMEOUT_MODAL', 'OSP:CONTENT:CONCOM:TOFFERS;CASHCOUPONS_CASH_IN_COINS_MODAL', 'SMBUS:APP:CARD;SMBUS:CARD:800:TIMEOUT_MODAL', 'OLB:CONTENT:ACCOUNTS:OPS;BOL_SECURE_LOG_IN_MODAL', 'MDA:CONTENT:DEALS;HOW_COINS_WORK_MODAL_ES', 'SMBUS:TOOL:BUSINESSADVANTAGE360;SELECT_ACCOUNTS_MODAL', 'GWM:MKT:MERRILLEDGE;ACCOUNT-SELECTOR-MODAL-RETIREMENT-MOBILE', 'OLB:CONTENT:FINWELL;MOVE_MONEY_MODAL', 'DEP:APP:CDP;CDP_NONOLB:105:CANCELMODAL', 'MDA:CONTENT:BILLPAY;PAYEE_EDIT_CONFIRMATION_MODAL', 'OSP:CONTENT:CONCOM:TOFFERS;CASHCOUPONS_COINS_RESET_MODAL_ES', 'GWM:MKT:MERRILLEDGE;ACCOUNT-SELECTOR-MODAL-RETIREMENT-DESKTOP', 'MDA:CONTENT:DEALS;NEARMEMAPNODEALSAVAILABLEMODAL', 'CARDS:APP:SP;CARD_SP:800:TIMEOUT_MODAL', 'CARD:APP:ICE;ICEPOS_NONOLB:175:RETURN_TO_DASHBOARD_MODAL', 'MDA:CONTENT:LOCATIONS;LOCATIONDISABLEDPROMPTMODAL', 'MDA:CONTENT:MYCONTACTINFO;DELETEEMAILMODAL', 'MDA:CONTENT:BILLPAY;PAYTOACCOUNTEDITCONFIRMMODAL', 'MDA:CONTENT:DEALS;HOW_LEVELS_WORK_MODAL_ES', 'MDA:CONTENT:DEALS;BONUS_COIN_DETAILS_MODAL', 'MDA:CONTENT:PAYPAL;IPAD_MODAL', 'GWM:MKT:MERRILLEDGE;GLOBAL-OAO-BROKERAGE-MODAL', 'DFS:APP:ALP;ALP_OLB:105:CANCELMODAL', 'HL:APP:HELOC;HELOC:800:TIMEOUT_MODAL', 'MDA:CONTENT:DEALS;ALLOWLOCATIONMODAL_ES', 'DFS:APP:ALP;ALP_NONOLB:105:CANCELMODAL', 'OLB:CONTENT:FINWELL;EDIT_GOAL_MODAL', 'MDA:CONTENT:BILLPAY;PAYTOACCOUNTDELETEMODAL', 'OLB:CONTENT:FINWELL;MANAGE_ACCOUNTS_MODAL', 'OLB:CONTENT:ACCTDETAILS:CARD;INFOSVCS_CARD_REPLACE_AD_ACCT_SELECT_MODAL', 'SMBUS:APP:CARD;SBCC_EC:800:TIMEOUT_MODAL', 'SMBUS:TOOL:BUSINESSADVANTAGE360;ALERTS_DETAILS_MODAL', 'DFS:APP:ALP;ALP_FC:105:CANCELMODAL', 'MDA:CONTENT:BILLPAY;SUCCESS_CANCEL_PREV_SCHED_PMNT_MODAL_ES', 'OLB:CONTENT:ACCTDETAILS:CARD;INFOSVCS_CARD_REPLACE_NO_ELIGIBLE_ACCTS_MODAL', 'MDA:CONTENT:DEALS;ALLOWLOCATIONSOMETHIGNWRONGMODAL', 'OLB:CONTENT:ACCTDETAILS;TRANSFERS_MAKE_PAYMENT_MODAL', 'OLB:CONTENT:FINWELL;DELETE_GOAL_MODAL', 'SMBUS:TOOL:BUSINESSADVANTAGE360;JUMP_TO_DATE_CALENDAR_MODAL', 'OLB:CONTENT:ACCOUNTS;TRANSFERS_MAKE_PAYMENT_MODAL', 'GWM:MKT:MERRILLEDGE;RMD-MODAL', 'HL:APP:DMA_REFI;DMAR_OLB:275:COUNTY_MODAL', 'MDA:CONTENT:MYCONTACTINFO;DELETEPHONEMODAL_ES', 'SMBUS:TOOL:BUSINESSADVANTAGE360;ONBOARDING_MODAL_ES', 'GWM:MKT:MERRILLEDGE;MARKETPRO-VIDEO-MODAL', 'HL:APP:HELOC;HELOC_OLB:105:CANCELMODAL', 'SMBUS:APP:DEP;SB_DEP_NONOLB:105:CANCELMODAL', 'OLB:CONTENT:FINWELL;CONTRIBUTE_TO_GOAL_MODAL', 'GWM:MKT:MERRILLEDGE;WHAT-YOU-WILL-NEED-MODAL', 'OSP:CONTENT:CONCOM:TOFFERS;CASHCOUPONS_HOW_COINS_WORK_MODAL_ES', 'OLB:CONTENT:FINWELL;CREATE_NEW_GOAL_MODAL_ES', 'SMBUS:TOOL:BUSINESSADVANTAGE360;ADD_A_PROJECTED_TRANSACTION_MODAL', 'SMBUS:TOOL:BUSINESSADVANTAGE360;EXPORT_CHART_DATA_MODAL', 'HL:APP:HELOC;HELOC_NONOLB:105:CANCELMODAL', 'OLB:CONTENT:ACCOUNTS;TRANSFERS_ADD_AN_ACCT_MODAL', 'GWM:MKT:MERRILLEDGE;ONLINE-TRADING-MODAL-RESEARCH', 'MDA:CONTENT:DEALS;ALLOWLOCATIONSOMETHIGNWRONGMODAL_ES', 'MDA:CONTENT:LOCATIONS;LOCATIONDISABLEDPROMPTMODAL_ES', 'MDA:CONTENT:DEALS;NEARMEMAPNODEALSAVAILABLEMODAL_ES', 'OLB:CONTENT:ACCTDETAILS;TRANSFERS_ADD_AN_ACCT_MODAL', 'SMBUS:APP:CARD;SB_ULOAN_OLB:105:CANCELMODAL', 'GWM:MKT:MERRILLEDGE;ONLINE-TRADING-MODAL-GUIDANCE', 'HL:APP:DMA_REFI;DMAR_NONOLB:275:COUNTY_MODAL', 'MDA:CONTENT:BILLPAY;EXTERNALACCOUNTDELETEMODAL', 'OLB:CONTENT:FINWELL;SET_BUDGET_MODAL_ES', 'OSP:CONTENT:CONCOM:TOFFERS;CASHCOUPONS_INTRODUCING_COINS_MODAL_ES', 'GWM:MKT:MERRILLEDGE;GLOBAL-OAO-INHERITED-IRA-MODAL', 'MDA:CONTENT:BILLPAY;PAYEE_EDIT_CONFIRMATION_MODAL_ES', 'MDA:CONTENT:BILLPAY;PAYTOACCOUNTEDITCONFIRMMODAL_ES', 'OLB:TOOL:FINWELL;EDIT_CATEGORY_MODAL_ES', 'OSP:TOOL:TRANSFERS;ADD_AN_ACCT_MODAL', 'DEP:APP:CDP;CDP_NONOLB:130:OOW_CANCELMODAL', 'GWM:MKT:MERRILLEDGE;ONLINE-TRADING-MODAL-STAY-ON-TRACK', 'MDA:CONTENT:MYCONTACTINFO;DELETEEMAILMODAL_ES', 'DFS:APP:ALP;ALP_CC:105:CANCELMODAL', 'GWM:MKT:MERRILLEDGE;FUND-IN-ONE-OF-FOUR-WAYS-MODAL', 'GWM:MKT:MERRILLEDGE;ONLINE-TRADING-MODAL-PERFORMANCE', 'OLB:CONTENT:FINWELL;MARK_GOAL_COMPLETE_MODAL', 'OSP:APP:FINWELL;FWA_MODAL', 'GWM:MKT:MERRILLEDGE;529-COMPARE-MODAL', 'GWM:MKT:MERRILLEDGE;QUOTE-HOVER-MODAL', 'MDA:CONTENT:DEALS;BONUS_COIN_DETAILS_MODAL_ES', 'DFS:APP:ALP;ALP_OLB_SNR:105:CANCELMODAL', 'GWM:MKT:MERRILLEDGE;PREFERRED-REWARDS-MODAL', 'GWM:MKT:MERRILLEDGE;SELECT-FUND-RESEARCH-MODAL', 'OLB:CONTENT:FINWELL;COMPLETED_GOALS_MODAL', 'GWM:MKT:MERRILLEDGE;GLOBAL-OAO-RETIREMENT-CASH-MGMT-MODAL', 'GWM:MKT:MERRILLEDGE;RUN_ECMS_MODAL', 'HL:APP:DMA_PURCH;DMAP_NONOLB:260:COUNTY_MODAL', 'OSP:TOOL:LIFEPLAN;APPT_MODAL', 'SMBUS:TOOL:BUSINESSADVANTAGE360;SELECT_ACCOUNTS_MODAL_ES', 'GWM:MKT:MERRILLEDGE;ADVERTISING-PRACTICES-MODAL', 'GWM:MKT:MERRILLEDGE;BEST-EXECUTION-TRADING-MODAL', 'GWM:MKT:MERRILLEDGE;CHOOSE-YOUR-OWN-SEARCH-CRITERIA-MODAL', 'GWM:MKT:MERRILLEDGE;CONTRIBUTION-LIMIT-MODAL', 'GWM:MKT:MERRILLEDGE;PRICING-MODAL', 'GWM:MKT:MERRILLEDGE;SEARCH-FOR-ETFS-MODAL', 'MDA:CONTENT:BILLPAY;PAYTOACCOUNTDELETEMODAL_ES', 'MDA:CONTENT:DEALS;NEARMEMAPOPTEDOUTMODAL', 'OSP:TOOL:LIFEPLAN;CREATE_A_GOAL_MODAL', 'SMBUS:TOOL:BUSINESSADVANTAGE360;LOW_NEGATIVE_ALERTS_MODAL', 'DEP:APP:CDP;CDP_OLB:105:CANCELMODAL', 'GWM:MKT:MERRILLEDGE;ACADEMY-VIDEO-MODAL', 'GWM:MKT:MERRILLEDGE;BROKER-CHECK-MODAL', 'GWM:MKT:MERRILLEDGE;FUND-IN-ONE-OF-FOUR-WAYS-MODAL_V2', 'GWM:MKT:MERRILLEDGE;SEARCH-FOR-FIXED-INCOME-MODAL', 'HL:APP:DMA_PURCH;DMAP_OLB:260:COUNTY_MODAL', 'OLB:CONTENT:ACCOUNTS;TRANSFERS_MAKE_PAYMENT_MODAL', 'SMBUS:TOOL:BUSINESSADVANTAGE360;ADJUST_BALANCE_ALERTS_MODAL', 'SMBUS:TOOL:BUSINESSADVANTAGE360;ALERTS_DETAILS_MODAL_ES', 'SMBUS:TOOL:BUSINESSADVANTAGE360;JUMP_TO_DATE_CALENDAR_MODAL_ES', 'DEP:APP:CDP;CDP_NONOLB_SNR:105:CANCELMODAL', 'GWM:MKT:MERRILLEDGE;CARD-ELIGIBILITY-GUIDELINES-MODAL', 'GWM:MKT:MERRILLEDGE;FINANCES-VIDEO-MODAL', 'GWM:MKT:MERRILLEDGE;HEALTH-VIDEO-MODAL', 'GWM:MKT:MERRILLEDGE;IRA-SELECTOR-TOOL-MODAL', 'GWM:MKT:MERRILLEDGE;JUGGLING-RETIREMENT-SAVING-VIDEO-MODAL', 'GWM:MKT:MERRILLEDGE;PRICING-MODAL-MOBILE', 'GWM:MKT:MERRILLEDGE;ROTH-IRA-CONVERSION-MODAL-WHAT-YOU-NEED', 'GWM:MKT:MERRILLEDGE;RUN_NEWECMSMODAL', 'GWM:MKT:MERRILLEDGE;SB401K-VIDEO-MODAL', 'GWM:MKT:MERRILLEDGE;SMALL-BUSINESS-VIDEO-MODAL', 'HL:APP:HELOC;HELOC_NONOLB_SNR:105:CANCELMODAL', 'HL:APP:HELOC;HELOC_OLB_SNR:105:CANCELMODAL', 'MDA:CONTENT:PAYPAL;IPAD_MODAL_ES', 'OLB:CONTENT:ACCOUNTS;TRANSFERS_ADD_AN_ACCT_MODAL', 'OLB:CONTENT:FINWELL;CONTRIBUTE_TO_GOAL_MODAL_ES', 'OLB:CONTENT:FINWELL;EDIT_GOAL_MODAL_ES', 'OLB:CONTENT:FINWELL;MANAGE_ACCOUNTS_MODAL_ES', 'OLB:CONTENT:FINWELL;MOVE_MONEY_MODAL_ES', 'OSP:CONTENT:CONCOM:TOFFERS;CASHCOUPONS_CASH_IN_COINS_MODAL_ES', 'SMBUS:TOOL:BUSINESSADVANTAGE360;ADD_A_PROJECTED_TRANSACTION_MODAL_ES', 'SMBUS:TOOL:BUSINESSADVANTAGE360;LOW_NEGATIVE_ALERTS_MODAL_ES' ]; // =========================================================================== // Functions fired on page load. // =========================================================================== /** * The initialization function is called immediately when the script loads. If loadCoremetrics * is false, this function will NOT be called. * @private * @returns {void} */ var _init = function () { _log('bactm library v' + version + ' initializing.', LOG_LEVEL.INFO); win.dataCollector = win.dataCollector || []; getCelebrusContentKey(); _ready(_onLoad); // If we haven't disabled the initial pageview on load in the DDO, go ahead and // queue up a pageview for the default instance. if (pageviewOnLoad) pageview(); // Add event listener to send a beacon with log data once the window unloads. var eventName = 'onpagehide' in window ? 'pagehide' : 'beforeunload'; window.addEventListener(eventName, _sendLogBeacon, false); _processSitePromotions(); _setPrivacy(); // Event listeners to capture custom events to indirectly access bactm methods _setBactmEventListeners(); }; Object.defineProperty(Array.prototype, "includes", { enumerable: false, value: function (obj) { var newArr = this.filter(function (el) { return el == obj; }); return newArr.length > 0; } }); /** * Queries the DOM every 300ms for up to 3s in order to detect all * site promotions and adds them to the data collector. */ var _processSitePromotions = function () { var querySitePromotions = setInterval(function () { if (SITE_PROMOTIONS_ACCUMULATOR > SITE_PROMOTIONS_THRESHOLD) { _trigger('sitePromotionsProcessed'); var event = new Event('sitePromotionsProcessed'); document.dispatchEvent(event); return clearInterval(querySitePromotions); } var links = polyfills.array.from(document.querySelectorAll('a')); var sitePromotionLinks = links.filter(function (link) { if (typeof link.dataset.impressionhref !== "undefined") { return polyfills.string.includes(link.dataset.impressionhref, 'cm_sp='); } else { return link?.attributes?.href?.value?.includes('cm_sp='); }; }); sitePromotionLinks.forEach(function (spLink) { function chooseLink() { if (typeof spLink.dataset.impressionhref !== "undefined") { return [new QueryString(spLink.dataset.impressionhref), spLink.dataset.impressionhref] } else { return [new QueryString(spLink?.attributes?.href?.value), spLink?.attributes?.href?.value] } } var sitePromotion = { event: 'sitepromotion', options: { value: chooseLink()[0].get('cm_sp'), href: chooseLink()[1] } }; if (!_isInDataCollector(sitePromotion)) dataCollector.push(sitePromotion) }); SITE_PROMOTIONS_ACCUMULATOR += SITE_PROMOTIONS_INTERVAL; }, SITE_PROMOTIONS_INTERVAL); } /** * Determines if an object is in the datacollector. */ _isInDataCollector = function (needle) { if (typeof needle !== 'object') return false; var dc = window.dataCollector || []; for (var i = 0; i < dc.length; i++) { var dcEvent = dc[i]; if (_is(dcEvent, needle)) return true; } return false; }; /** * Determines if two objects have the same keys and values. */ _is = function (o1, o2) { if (typeof o1 !== 'object' || typeof o2 !== 'object') return false var o1k = Object.keys(o1); return o1k.every(function (key) { if (!o2.hasOwnProperty(key)) return false; if (typeof o1[key] === 'object') return _is(o1[key], o2[key]) return o1[key] === o2[key] }); }; /** * Called once the custom event named in cmLibLoadEventName is dispatched and the * DOM is fully ready. * @private * @returns {void} */ var _onLoad = function () { // Intialize our dataCollector queue and tell it to process anything already in the queue. win.dataCollector = win.dataCollector || []; var dataCollectorQueue = new _dataCollectorHelper(win.dataCollector, _processDataCollector, true); _impressions(); window.cX = () => { if (window?.bactm?.rescanDOM) bactm.rescanDOM(); } _dynamicContentWatcher() } /** * listening for two events that fire after dynamic content is injected * first event: sparta dynamic content 2nd event: events fired by page owner * either event that we get we will call rescanDOM * @private function */ const _dynamicContentWatcher = () => { // incase we ever had a scenario to deregister the listener do not use an anonymous call back document.addEventListener('MODAL_OPENED.spartaUILayersUtility', _rescanDOM) document.addEventListener('tagging-dynamic-content', _rescanDOM) } // =========================================================================== // End functions fired on page load. // =========================================================================== // =========================================================================== // Core data collection functions. // =========================================================================== /** * Fires a Coremetrics pageview tag for the pageInfo object requested according * to and modified if necessary based on properties in the options object. * @private * @requires eluminate.js * @requires cmdatatagutils.js * @param {string|number} [pageInfoKey] - Value indicating how to find the pageInfo * from the digitalData object. Can be the index of the array, pageID, or the * associated value. * @param {object} [options] - Object of options for this pageview call. Valid * properties include segmentValues {array}, categoryType {string}, lookupType {string}, * isSaveAndReturn {bool}, saveAndReturnId {string}, applicationId {string} * cartProducts {array} and isApp {bool}. * @returns {boolean} */ var _firePageview = function (pageInfoKey, options) { var options = options || {} , pageInfoArrayIndex = _lookupArrayIndexByKey(pageInfoKey, options); _processOptions(pageInfoArrayIndex, options); _log('Call pageview on array index ' + pageInfoArrayIndex + ' with options: ', options, LOG_LEVEL.DEBUG); if (_toLowerCaseString(ddo.get('page.attributes.stateCookie')) === 'true') _setStateSegmentValue(pageInfoArrayIndex); if (_toLowerCaseString(ddo.get('page.attributes.needOLBcookie')) === 'true') _setOLBSegmentValue(pageInfoArrayIndex); if (_toLowerCaseString(ddo.get('user.sharedIDs.celebrus')) !== null) _setSegmentValue('cck', ddo.get('user.sharedIDs.celebrus'), pageInfoArrayIndex); _setWindowResolutionSegmentValue(pageInfoArrayIndex); _setSNRSegmentValue(pageInfoArrayIndex); // _setmdaCmParams(); var pageInfo = _getPageInfo(pageInfoArrayIndex, options); if (!pageInfo) { _log('Unable to fire pageview. pageInfo object is null or does not exist.', LOG_LEVEL.INFO); return; } if (options.isModal) return true; _log('Firing a pageview with the following info: ', pageInfo, LOG_LEVEL.INFO); _trigger('beforePageview', { 'pageInfoArrayIndex': pageInfoArrayIndex , 'pageInfo': pageInfo , 'options': options }); // Capture the pageview. _pageIDHistory('add', pageInfoArrayIndex, pageInfo.pageID); _impressions(); _trigger('afterPageview', { 'pageInfoArrayIndex': pageInfoArrayIndex , 'pageInfo': pageInfo , 'options': options }); _trigger('afterPageviewAAM', { 'pageInfoArrayIndex': pageInfoArrayIndex , 'pageInfo': pageInfo , 'options': options }); _trigger('afterPageviewAdobe', { 'pageInfoArrayIndex': pageInfoArrayIndex , 'pageInfo': pageInfo , 'options': options }); _trigger('initClickAttributes', { 'pageInfoArrayIndex': pageInfoArrayIndex , 'pageInfo': pageInfo , 'options': options }); _trigger('initTargetValues', { 'pageInfoArrayIndex': pageInfoArrayIndex , 'pageInfo': pageInfo , 'options': options }); _trigger('initChatPageView', { 'pageInfoArrayIndex': pageInfoArrayIndex , 'pageInfo': pageInfo , 'options': options }); _trigger('initDLEValues', { 'pageInfoArrayIndex': pageInfoArrayIndex , 'pageInfo': pageInfo , 'options': options }); _trigger('setupDartTags', { 'pageInfoArrayIndex': pageInfoArrayIndex, 'pageInfo': pageInfo, 'options': options }); } /** * Captures all products out of the digitalData.cart.item array and fires a Coremetrics * Shop Action 5 tag for each one where cartViewTagFired property is false. Once tag has * fired, cartViewTagFired property is set to true, ensuring duplicate Shop Action 5 tags * are not fired for a single product. * @private * @requires eluminate.js * @requires cmdatatagutils.js * @returns {void} */ var _fireCartView = function () { if (typeof bactm_cmCreateShopAction5Tag !== 'function') return; _trigger('beforeCartView'); var products = ddo.get('cart.item', []); for (var i = 0, len = products.length; i < len; i++) { if (!products[i].attributes || !products[i].attributes.cartViewTagFired) { try { products[i].attributes = products[i].attributes || {}; products[i].attributes.cartViewTagFired = true; } catch (e) { _log(e, LOG_LEVEL.ERROR); reportError(e); } } } ddo.set('cart.item', products); // Save cart to the store so it can be loaded from other DOM instances. _saveCartToStore(); _trigger('afterCartView'); } /** * Captures all products out of the digitalData.cart.item array and fires a Coremetrics * Shop Action 9 tag for each one where cartViewTagFired property is true. Once tag has * fired, cartViewTagFired property is set to false, ensuring additional Shop Action 5 tags * can be fired. * @private * @requires eluminate.js * @requires cmdatatagutils.js * @returns {void} */ var _fireProductsPurchased = function () { // from ML bactm var gwimPg = window.digitalData.page.pageInfo[0].pageID; if (gwimPg.match(/GWIM:/gi) != null) { _trigger('afterCartAdobe'); return; }; if (typeof bactm_cmCreateShopAction9Tag !== 'function') return; _trigger('beforeProductsPurchased'); var products = ddo.get('cart.item', []); for (var i = 0, len = products.length; i < len; i++) { if (products[i].attributes && _toLowerCaseString(products[i].attributes.cartViewTagFired) !== 'false') { try { products[i].attributes = products[i].attributes || {}; products[i].attributes.cartViewTagFired = false; } catch (e) { _log(e, LOG_LEVEL.ERROR); } } } ddo.set('cart.item', products); // Save cart to the store so it can be loaded from other DOM instances. _saveCartToStore(); _trigger('afterProductsPurchased'); } /** * Captures all products out of the digitalData.product array and fires a Coremetrics * Productview tag for each one where productviewTagFired property is false. Once tag has * fired, productviewTagFired property is set to true, ensuring duplicate Productview tags * are not fired. * @private * @requires eluminate.js * @requires cmdatatagutils.js * @returns {void} */ var _fireProductview = function () { _trigger('beforeProductview'); var products = ddo.get('product', []); for (var i = 0, len = products.length; i < len; i++) { if (!products[i].attributes || !products[i].attributes.productviewTagFired) { try { products[i].attributes = products[i].attributes || {}; products[i].attributes.productviewTagFired = true; } catch (e) { _log(e, LOG_LEVEL.ERROR); reportError(e); } } } ddo.set('product', products); _trigger('afterProductview'); } /** * Sends a conversion event tag to Coremetrics. * @private * @requires eluminate.js * @requires cmdatatagutils.js * @param {string} eventName - The unique identifier for the type of conversion event. * @param {string} actionType - Indicates whether the conversion event was initiated or * successfully completed. Valid values: initiate|complete * @param {string} category - Allows you to group events into a category. * @returns {void} */ var _fireConversionEvent = function (eventName, actionType, category) { var conversion = { eventName: eventName , actionType: actionType , category: category }; _trigger('beforeConversion', { 'conversion': conversion }); _trigger('afterConversion', { 'conversion': conversion }); } /** * Sends a Custom Error tag for the current page to Coremetrics. * @private * @requires eluminate.js * @requires cmdatatagutils.js * @param {string|number} errorCode - A unique identifier for the Error message. * @param {string} errorMessage - The text of the message that is displayed to the user. * @returns {void} */ var _fireCustomError = function (errorCode, errorMessage) { var eventInfo = { 'event': 'customError' , 'errorCode': errorCode , 'errorMessage': errorMessage }; _trigger('beforeCustomError', eventInfo); // var pageID = window?.digitalData?.page?.pageInfo[0]?.pageID; // var categoryID = pageID.split(';')[0]; _trigger('afterCustomError', eventInfo); } /** * Sends a Manual Link Click tag on the current page to Coremetrics. * @private * @requires eluminate.js * @requires cmdatatagutils.js * @param {string} href - The href for the hyperlink. * @param {string} linkname - The unique descriptive identifier for the link. * @returns {void} */ var _fireManualLinkClick = function (href, linkname) { var eventInfo = { 'event': 'manualLinkClick' , 'href': href , 'linkname': linkname }; _trigger('beforeManualLinkClick', eventInfo); if (!href || href === '' || href === '#') { href = 'javascript:void(0);'; } // Triggers Adobe TrackClick Functionality with every manual link click if (!window.location.href.includes("alloy=true")) { if (href.includes("cm_sp")) { try { const mockAdobeLink = document.createElement('a'); mockAdobeLink.href = href; mockAdobeLink.dataset.impressionhref = href; mockAdobeLink.dataset.aaClickEvent = true; mockAdobeLink.id = linkname || "manualAdobeLinkClick"; mockAdobeLink.addEventListener('click', (event) => { event.preventDefault(); if (typeof window.bactm?.plugins?.adobesensei?.manualAdobeLinkClick === "function") { window.bactm.plugins.adobesensei.manualAdobeLinkClick(event) } }); mockAdobeLink.click() } catch (e) { _log(e, LOG_LEVEL.ERROR); reportError(e); } } } _trigger('afterManualLinkClick', eventInfo); } /** * Reverts the pageID Coremetrics is currently reporting on to the previous pageID. * Uses a specific pageID from the specified index of the array if provided. * For example, to be called when modal layer that called a second Pageview tag in * a single DOM instance is closed. * @private * @requires eluminate.js * @param {number} [pageInfoArrayIndex=null] - Index of the pageInfo array from * digitalData.page.pageInfo[n] you'd like the get the paegID from. * @returns {void} */ var _revertToPreviousPageID = function (pageInfoArrayIndex) { var pageID = ''; if (!isNaN(pageInfoArrayIndex)) { if (!_isValidPageInfoArrayIndex(pageInfoArrayIndex)) pageInfoArrayIndex = 0; pageID = ddo.pageInfo.get('pageID', pageInfoArrayIndex); } else { pageID = _pageIDHistory('prev'); } return pageID } /** * Rescans the DOM and adds event handlers to anchor tags for Automatic Link Click tag * functionality. * @private * @returns {void} */ var _rescanDOM = function () { try { _trigger('adobeListeners'); bactm.impressions(); } catch (e) { reportError(e); } } /** * Adds an event to the log queue which will get sent on page unload. * @private * @param {object} data * @returns {void} */ var _addToLogQ = function (data) { var q = logQ || []; q.push(data); } // =========================================================================== // End core data collection functions. // =========================================================================== // =========================================================================== // Helper functions. // =========================================================================== var _impressions = function (individualImpression = false) { const pageID = _pageIDHistory('current'); // Adds impression to the dataCollector function setToDataCollector(spLink) { var qs = new QueryString(spLink); var sitePromotion = { event: 'sitepromotion', options: { value: qs.get('cm_sp'), href: spLink } }; if (!_isInDataCollector(sitePromotion)) dataCollector.push(sitePromotion); } // Manual Impression Tag functionality if (individualImpression) { const impressionArr = Array.isArray(individualImpression) ? individualImpression : [individualImpression]; impressionArr.forEach(function (spLink) { setToDataCollector(spLink) }); return impressionArr; } // Fires Adobe Analytics Impression Tag on initial load or when bactm.impressions doesn't pass an argument // Build an array of the previous hrefs from impressions tags that have been fired already const previousImpressions = window.dataCollector.filter( (element) => element.event === 'sitepromotion' && element.options.value ); // Build and array of all the cm_sp anchors on the page const allImpressionsFound = Array.from( document.getElementsByTagName('a') ).filter( (anchor) => anchor.dataset.impressionhref || anchor?.attributes?.href?.value?.includes('cm_sp') ); // Build an array and filter to eliminate impressions already present in the dataCollector. const sharedValuesFound = allImpressionsFound.filter((cmsp) => previousImpressions.find((prev) => cmsp.href.includes(prev.options.value) ) ); const getCmspAnchors = allImpressionsFound.filter( (item) => !sharedValuesFound.includes(item) ); var urlArr = []; getCmspAnchors.forEach((filteredAnchor) => { let hrefValue = filteredAnchor.dataset.impressionhref || filteredAnchor?.attributes?.href?.value; urlArr.push(hrefValue); }); // Fires impression tags for Adobe Analytics urlArr.forEach((link) => { setToDataCollector(link); }); } var _setPrivacy = function () { if (!ddo.get("privacy")) { ddo.set("privacy", { do_not_track: false }); } if (!ddo.get("privacy.do_not_track")) { ddo.set("privacy.do_not_track", false); } var tv = _readCookie("throttle_value"); ddo.set("privacy.do_not_track", (tv === "999") ? true : ddo.get("privacy.do_not_track")); ddo.set("privacy.do_not_track", (navigator.doNotTrack == 1) ? true : ddo.get("privacy.do_not_track")); } /** * Function used to process objects added to the dataCollector array. Objects * should include an event property. Currently 'pageview' is the only supported * event. All other objects added will be ignored. * @private * @param {object} message - Object containing event type and options for selected * event. 'pageview', 'manualLinkClick', and 'customError' are currently the * only supported events. * For pageview events, if no other properties are found, a pageview will be * fired on digitalData.page.pageInfo[0] with no options. * @returns {void} */ var _processDataCollector = function (message) { _log('dataCollector processing: ', message, LOG_LEVEL.DEBUG); var _event = _toLowerCaseString(message.event); var events = { 'pageview': function () { _firePageview(message.pageInfoKey || 0, message.options || {}); var pageId = ddo.pageInfo.get('pageID', message.pageInfoKey, ''); if (_logPageviewToSplunk[pageId]) log({ type: 'pageview', pageId: pageId }); } , 'productview': function () { _fireProductview(); } , 'cartview': function () { _fireCartView(); } , 'productspurchased': function () { _fireProductsPurchased(); } , 'conversion': function () { _fireConversionEvent(message.eventName, message.actionType, message.category); } , 'manuallinkclick': function () { _fireManualLinkClick(message.href, message.linkname); } , 'customerror': function () { _fireCustomError(message.errorCode, message.errorMessage); } , 'customevent': function () { var details = message.options || {}; details['eventKey'] = message.eventKey; _trigger('customEvent', details); } , 'log': function () { var data = message.data || {}; _addToLogQ(data); } } if (events[_event]) { events[_event](); } } /** * Takes a pageInfoKey and options object and finds the proper pageInfo array index. * @private * @param {string|number} [pageInfoKey] - Value indicating how to find the pageInfo * from the digitalData object. Can be the index of the array, pageID, or the * associated value. * @param {object} [options] - Object of options for this pageview call. Valid * properties include segmentValues {array}, categoryType {string}, lookupType {string}, * isSaveAndReturn {bool}, saveAndReturnId {string}, applicationId {string} * cartProducts {array} and isApp {bool}. * @returns {number} pageInfoArrayIndex */ var _lookupArrayIndexByKey = function (pageInfoKey, options) { var options = options || {} , pageInfoKeyIsString = typeof pageInfoKey === 'string' , pageInfoArrayIndex = 0; if (pageInfoKey) { if (pageInfoKeyIsString && _toLowerCaseString(options.lookupType) === 'associatedvalue') { pageInfoArrayIndex = _findPageInfoArrayIndexByAssociatedValue(pageInfoKey); if (pageInfoArrayIndex === -1) { _log('Unable to find pageInfo matching the specified associated value. Defaulting to zero.', LOG_LEVEL.WARN); pageInfoArrayIndex = 0; } } else if (pageInfoKeyIsString) { pageInfoArrayIndex = _findPageInfoArrayIndexByPageID(pageInfoKey); if (pageInfoArrayIndex === -1) { _log('Unable to find pageInfo matching the specified pageID. Defaulting to zero.', LOG_LEVEL.WARN); pageInfoArrayIndex = 0; } } else { if (_isValidPageInfoArrayIndex(pageInfoKey)) pageInfoArrayIndex = pageInfoKey; } } return pageInfoArrayIndex; } /** * Processes proper logic based on the options provided. * @private * @param {number} pageInfoArrayIndex - Index of the pageInfo array to associate with the provided options. * @param {object} options * @param {boolean} options.authenticated - If set, will update the digitalData object indiciating the current user is authenticated. * @param {string} options.applicationId - If set, will update the digitalData object with the provided application identifier. * @param {string} options.applicationDecision - If set, will update the digitalData object with the provided application decision. * @param {string} options.saveAndReturnId - If set, will update the digitalData object with the provided save and return identifier. * @param {string} options.segmentValues - If set, will update the digitalData object at the provided pageInfo array index with the provided segment values. * @param {object|array} options.cartProducts - If set, will update the digitalData.cart object with the provided products. * @param {boolean} options.isApp - Indicate if this is pageview is part of an application. * @param {boolean} options.isSaveAndReturn - Indicate if this pageview is part of a save and return application. * @returns {void} */ var _processOptions = function (pageInfoArrayIndex, options) { /** * While not as "pretty," using independant if statements is 57% faster rather than a * loop for each optional property using the _setProperty function. */ if (typeof options.loadCart !== 'undefined' && _toLowerCaseString(options.loadCart) === 'true') { _loadCartFromStore(); delete options.loadCart; } if (typeof options.clickDART !== 'undefined') { _setProperty('clickDART', options.clickDART, pageInfoArrayIndex); delete options.clickDART; } if (typeof options.authenticated !== 'undefined') { _setProperty('authenticated', options.authenticated); delete options.authenticated; } if (typeof options.applicationId !== 'undefined') { _setProperty('applicationId', options.applicationId); delete options.applicationId; } if (typeof options.applicationDecision !== 'undefined') { _setProperty('applicationDecision', options.applicationDecision); delete options.applicationDecision; } if (typeof options.saveAndReturnId !== 'undefined') { _setProperty('saveAndReturnId', options.saveAndReturnId, pageInfoArrayIndex); delete options.saveAndReturnId; } if (typeof options.standardDART !== 'undefined') { _setProperty('standardDART', options.standardDART, pageInfoArrayIndex); delete options.standardDART; } if (typeof options.standardDARTes !== 'undefined') { _setProperty('standardDARTes', options.standardDARTes, pageInfoArrayIndex); delete options.standardDARTes; } if (typeof options.mboxCreateParam !== 'undefined') { _setProperty('mboxCreateParam', options.mboxCreateParam, pageInfoArrayIndex); // delete options.mboxCreateParam; } if (typeof options.mboxCreateParam_es !== 'undefined') { _setProperty('mboxCreateParam_es', options.mboxCreateParam_es, pageInfoArrayIndex); // delete options.mboxCreateParam_es; } if (typeof options.mboxCreateArgs !== 'undefined') { _setProperty('mboxCreateArgs', options.mboxCreateArgs, pageInfoArrayIndex); delete options.mboxCreateArgs; } if (typeof options.chat !== 'undefined') { _setProperty('chat', options.chat, pageInfoArrayIndex); delete options.chat; } if (typeof options.segmentValues !== 'undefined') { addManySegmentValues(options.segmentValues, pageInfoArrayIndex); delete options.segmentValues; } if (typeof options.cartProducts !== 'undefined') { addProductsToCart(options.cartProducts); delete options.cartProducts; } options['isApp'] = _toLowerCaseString(options.isApp) === 'true' ? true : false; options['isSaveAndReturn'] = _toLowerCaseString(options.isSaveAndReturn) === 'true' ? true : false; } /** * Get all page info properties required to process a pageview. Merges in required properties * found outside the pageInfo object, localizes pageID to the language, and builds the dynamic * pageID if this is an app call. * @private * @param {number} [pageInfoArrayIndex=0] - Index of the pageInfo array from * digitalData.page.pageInfo[n] you'd like the get the segment values from. * @param {object} [options] - Object containing options for building page info. * @param {boolean} [options.isApp=false] - Is this an app that we should dynamically build * the pageID and app information. * @param {string} [options.categoryType='primary'] - Determine if to use * digitalData.page.category.addlCategory[n] or primaryCategory. * @param {number} [options.addlCategoryIndex] - Index of the addlCategory array from * digitalData.page.category.addlCategory[n] you'd like to use. * @returns {object} pageInfo */ var _getPageInfo = function (pageInfoArrayIndex, options) { if (!_isValidPageInfoArrayIndex(pageInfoArrayIndex)) pageInfoArrayIndex = 0; options = options || {}; // If we get a null pageID, try to get it from Coremetrics--otherwise return blank. var pageInfo = _clone(ddo.get('page.pageInfo[' + pageInfoArrayIndex + ']')); if (!pageInfo.pageID) pageInfo['pageID'] = ''; // Return the primaryCategory unless we've requested the additional category. var category = ddo.get('page.category.primaryCategory'); if (typeof (options.addlCategoryIndex) !== 'undefined' || _toLowerCaseString(options.categoryType) === 'additional') { var additionalCat = ddo.get('page.category.addlCategory'); if (Array.isArray(additionalCat)) { if (_isValidAddlCategoryArrayIndex(options.addlCategoryIndex)) { category = additionalCat[options.addlCategoryIndex]; } else { category = additionalCat[0]; } } else { category = additionalCat; } var pageIDsplit = pageInfo.pageID.split(';'); if (pageIDsplit.length > 1 && pageIDsplit[0] !== category) { pageInfo.pageID = category + ";" + pageIDsplit[1]; } } // If we are dealing with an app, we will need to customize some of the page info before continueing. var isApp = ((pageInfo.appName && pageInfo.appStepNumber) || options.isApp === true) ? true : false; if (isApp) pageInfo = _getAppPageInfo(pageInfo, category, options.isSaveAndReturn); // Customize pageInfo data for this instance and centralize data found in other parts of the DDO. var _pageInfo = pageInfo || {}; _pageInfo['pageID'] = _localizePageID(pageInfo.pageID, pageInfo.language); _pageInfo['applicationID'] = ddo.get('cart.applicationID'); _pageInfo['category'] = category; _pageInfo['attr'] = _getAttrValue(pageInfo); _pageInfo['searchString'] = ddo.get('page.attributes.searchString'); _pageInfo['searchResults'] = ddo.get('page.attributes.searchResults'); _pageInfo['olbSessionID'] = ddo.get('page.attributes.olbSessionID'); _pageInfo['subCampaignCode'] = ddo.get('page.attributes.subCampaignCode'); _pageInfo['authenticated'] = (_toLowerCaseString(ddo.get('user.authenticated')) === 'true') ? true : false; _pageInfo['pageInfoArrayIndex'] = pageInfoArrayIndex; return _pageInfo; } /** * Build the custom pageID and appName for an app. Returns all previous pageInfo * properties passed in as part of the pageInfo object. * @private * @param {object} pageInfo - pageInfo object containing at a minimum appName, * appStepNumber, and appStepName. * @param {string} [category] - Category to use in the pageID build. If not * provided, digitalData.page.category.primaryCategory will be used. * @returns {object} pageInfo */ var _getAppPageInfo = function (pageInfo, category, isSaveAndReturn) { var cat = category || ddo.get('page.category.primaryCategory', ''); pageInfo = pageInfo || {}; pageInfo['originalAppName'] = pageInfo.appName || 'None'; pageInfo['appName'] = pageInfo.appName + '_' + (_toLowerCaseString(ddo.get('user.authenticated')) === 'true' ? 'OLB' : 'NonOLB') + (isSaveAndReturn ? '_SNR' : ''); pageInfo['pageID'] = cat + ';' + pageInfo.appName + ':' + pageInfo.appStepNumber + ':' + pageInfo.appStepName; return pageInfo; } /** * Returns an object with all the values found in digitalData.page.pageInfo[n].segmentValue * as key/value pairs of the returned object. * @private * @param {number} [pageInfoArrayIndex=0] - Index of the pageInfo array from * digitalData.page.pageInfo[n] you'd like the get the segment values from. * @returns {object} segments */ var _getSegmentValues = function (pageInfoArrayIndex) { if (!_isValidPageInfoArrayIndex(pageInfoArrayIndex)) pageInfoArrayIndex = 0; var segmentValue = ddo.pageInfo.get('segmentValue', pageInfoArrayIndex); if (!segmentValue) return {}; var segmentPairs = _trim(segmentValue).split(segmentValueSeperator); var segments = {}; for (var i = 0, segmentPairsLen = segmentPairs.length; i < segmentPairsLen; i++) { var segment = _getSegmentKeyValue(segmentPairs[i]); segments[segment.key] = segment.value; } return segments; } /** * Writes the provided string to digitalData.page.pageInfo[n].segmentValue * @private * @param {string} value - String of segments as pipe wrapped key/value pairs (e.g.: '|st_NC||olbc_Y|'). * @param {number} [pageInfoArrayIndex=0] - Index of the pageInfo array from * digitalData.page.pageInfo[n] you'd like the get the segment values from. * @returns {void} */ var _saveSegmentValues = function (value, pageInfoArrayIndex) { if (!_isValidPageInfoArrayIndex(pageInfoArrayIndex)) pageInfoArrayIndex = 0; ddo.pageInfo.set('segmentValue', value, pageInfoArrayIndex); } /** * Returns the value of a single segment within digitalData.page.pageInfo[n].segmentValue * found by key. * @private * @param {string} key - Key is the entire string up unti the first underscore in a segment * section (e.g.: 'st' in '|st_NC|'). * @param {number} [pageInfoArrayIndex=0] - Index of the pageInfo array from * digitalData.page.pageInfo[n] you'd like the get the segment values from. * @returns {string} value */ var _getSegmentValue = function (key, pageInfoArrayIndex) { if (!_isValidPageInfoArrayIndex(pageInfoArrayIndex)) pageInfoArrayIndex = 0; var current = _getSegmentKeyValues(pageInfoArrayIndex); return current[key]; } /** * Sets the value of a single segment within digitalData.page.pageInfo[n].segmentValue * found by key. If key does not exist, a new segment will be created. * @private * @param {string} key - Key is the entire string up unti the first underscore in * a segment section (e.g.: 'st' in '|st_NC|'). * @param {string} value - Vaue is the entire string after the first underscore in * a segment section (e.g.: 'NC' in '|st_NC|'). * @param {number} [pageInfoArrayIndex=0] - Index of the pageInfo array from * digitalData.page.pageInfo[n] you'd like the get the segment values from. * @returns {void} */ var _setSegmentValue = function (key, value, pageInfoArrayIndex) { if (!_isValidPageInfoArrayIndex(pageInfoArrayIndex)) pageInfoArrayIndex = 0; var segmentValuesString = ''; var current = _getSegmentValues(pageInfoArrayIndex); current[_trim(key)] = value ? _trim(value) : ''; for (var key in current) { if (current.hasOwnProperty(key)) { segmentValuesString += segmentWrapperChar + key + (current[key] !== '' ? '_' + current[key] : '') + segmentWrapperChar; } } _saveSegmentValues(segmentValuesString, pageInfoArrayIndex); } /** * Returns an object with a key and a value from an underscore seperated string. * If no underscore is found, entire value is put within the key. * @private * @param {string} segment - Key and value string seperated by an underscore (e.g.: 'st_NC', 'olbc_Y'). * @returns {object} segment */ var _getSegmentKeyValue = function (segment) { var firstUnderscore = segment.indexOf('_'); if (firstUnderscore > -1) { key = segment.substring(0, firstUnderscore); value = segment.substring(firstUnderscore + 1); } else { key = segment; value = ''; } return { key: key, value: value }; } /** * Sets the state segment value based on the state cookie. * @private * @param {number} [pageInfoArrayIndex=0] - Index of the pageInfo array from * digitalData.page.pageInfo[n] you'd like the set the segment values to. * @returns {void} */ var _setStateSegmentValue = function (pageInfoArrayIndex) { if (!_isValidPageInfoArrayIndex(pageInfoArrayIndex)) pageInfoArrayIndex = 0; var stateFromCookie; if (_toLowerCaseString(ddo.get('page.attributes.stateCookie')) === 'true') stateFromCookie = _readCookie('state'); if (stateFromCookie) _setSegmentValue('st', stateFromCookie, pageInfoArrayIndex); } /** * Sets the olbc segment value based on the BA_0021 cookie. * @private * @param {number} [pageInfoArrayIndex=0] - Index of the pageInfo array from * digitalData.page.pageInfo[n] you'd like the set the segment values to. * @returns {void} */ var _setOLBSegmentValue = function (pageInfoArrayIndex) { if (!_isValidPageInfoArrayIndex(pageInfoArrayIndex)) pageInfoArrayIndex = 0; var authenticated = 'N'; if (_readCookie('BA_0021')) authenticated = 'Y'; _setSegmentValue('olbc', authenticated, pageInfoArrayIndex); } /** * Sets the rez segment value based on the current innerWidth and innerHeight of the document. * @private * @param {number} [pageInfoArrayIndex=0] - Index of the pageInfo array from * digitalData.page.pageInfo[n] you'd like the set the segment values to. * @returns {void} */ var _setWindowResolutionSegmentValue = function (pageInfoArrayIndex) { if (!_isValidPageInfoArrayIndex(pageInfoArrayIndex)) pageInfoArrayIndex = 0; var value = win.innerWidth + '_' + win.innerHeight; _setSegmentValue('rez', value, pageInfoArrayIndex); } /** * Sets the SNR segment value if the pageInfo[pageInfoArrayIndex].saveAndReturnId property is populated. * @private * @param {number} [pageInfoArrayIndex=0] - Index of the pageInfo array from * digitalData.page.pageInfo[n] you'd like the set the segment values to. * @returns {void} */ var _setSNRSegmentValue = function (pageInfoArrayIndex) { if (!_isValidPageInfoArrayIndex(pageInfoArrayIndex)) pageInfoArrayIndex = 0; try { var SNR = ddo.pageInfo.get('saveAndReturnId', pageInfoArrayIndex); if (SNR) _setSegmentValue('SNR', SNR, pageInfoArrayIndex); } catch (e) { reportError(e); } } /** * Gets the attr value by adding the current segment value to any existing values within attr. * @private * @param {object} pageInfo - pageInfo object with minimum properties segmentValue and attr. * @returns {string} attr */ var _getAttrValue = function (pageInfo) { if (pageInfo.attr) { var attributes = pageInfo.attr.split(attrValueSeperator); } else { var attributes = []; } if (attributes.length > 0) { attributes[0] += pageInfo.segmentValue; } attributes[9] = '1'; return attributes.join(attrValueSeperator); } /** * An abstraction layer allowing the development teams to set properties on * the digitalData object (DDO) without having to know the structure of the DDO and * manipulate it directly. * @public * @param {string} property - Property type: authenticated|applicationID * @param {string|number|boolean} value - Value to set the property to. * @returns {void} */ var _setProperty = function (property, value, pageInfoArrayIndex) { var setAuth = function () { if (_toLowerCaseString(value) === 'true' || _toLowerCaseString(value) === 'false') { ddo.set('user.authenticated', (_toLowerCaseString(value) === 'true') ? true : false); } } var setAppID = function () { ddo.set('cart.applicationID', value); } var setAppDecision = function () { ddo.set('cart.applicationDecision', value); } var setPageInfoProperty = function () { if (_isValidPageInfoArrayIndex(pageInfoArrayIndex)) { ddo.pageInfo.set(property, value, pageInfoArrayIndex); } } var commands = { 'authenticated': setAuth , 'applicationId': setAppID , 'applicationDecision': setAppDecision , 'isModal': setPageInfoProperty , 'standardDART': setPageInfoProperty , 'standardDARTes': setPageInfoProperty , 'mboxCreateParam': setPageInfoProperty , 'mboxCreateParam_es': setPageInfoProperty , 'mboxCreateArgs': setPageInfoProperty , 'chat': setPageInfoProperty , 'saveAndReturnId': setPageInfoProperty , 'clickDART': setPageInfoProperty }; if (commands[property]) { commands[property](); } } /** * Provides a localized pageID by adding the language abbreviation to the end of the pageID * if other than 'en'. Does not add if the pageID already ends in the provided language abbreviation. * @private * @param {string} pageID - Full pageID. * @param {string} language - Two letter abbreviation for the langauge (e.g.: 'es', 'en', etc.). * @returns {string} */ var _localizePageID = function (pageID, language) { ctryCd = /([A-Za-z]){2}[\:\;_-]/ language = (ctryCd.exec(language)) ? language.substr(0, ctryCd.exec(language).length) : language if (!language || language.toLowerCase().indexOf('en') > -1 || pageID.slice(-3).toUpperCase() === '_' + language.toUpperCase()) return pageID; else return pageID + '_' + language.toUpperCase(); } /** * Add products to the digitalData object (DDO) without needing to manage the DDO structure. * Does not add if we find a product with a matching product ID already in the DDO. * @private * @param {object|array} products * @param {string|number} product.productID - Unique identifier for the product. * @param {string} product.productName - Friendly name of the product. * @param {string} product.productCategory - Category product belongs to. * @returns {void} */ var _addProducts = function (products) { if (!Array.isArray(products) && typeof products !== 'object') throw new TypeError('addProducts requires a product object or an array of product objects.'); products = _asArray(products); var ddoProducts = ddo.get('product', []); for (var i = 0, productsLen = products.length; i < productsLen; i++) { // If a product by the same ID already exists, no need to re-add it. if (_findArrayIndexByProperty(ddoProducts, 'productInfo.productID', products[i].productID, true) === -1) { ddoProducts.push({ 'productInfo': { 'productID': products[i].productID , 'productName': products[i].productName , 'accountType': products[i].accountType ? products[i].accountType : null } , 'category': { 'primaryCategory': products[i].productCategory }, 'attributes': { 'productviewTagFired': false } }); } } } /** * Add products to the digitalData object (DDO) cart without needing to manage the DDO structure. * Does not add if we find a product with a matching product ID already in the DDO. * @private * @param {object|array} products * @param {string|number} product.productID - Unique identifier for the product. * @param {string} product.productName - Friendly name of the product. * @param {string} product.productCategory - Category product belongs to. * @returns {void} */ var _addProductsToCart = function (products) { if (!Array.isArray(products) && typeof products !== 'object') throw new TypeError('addProductsToCart requires a product object or an array of product objects.'); products = _asArray(products); var ddoProducts = ddo.get('cart.item', []); for (var i = 0, productsLen = products.length; i < productsLen; i++) { // If a product by the same ID already exists, no need to re-add it. if (_findArrayIndexByProperty(ddoProducts, 'productInfo.productID', products[i].productID, true) === -1) { ddoProducts.push({ 'productInfo': { 'productID': products[i].productID , 'productName': products[i].productName , 'accountType': products[i].accountType ? products[i].accountType : null } , 'category': { 'primaryCategory': products[i].productCategory } , 'attributes': { 'cartViewTagFired': products[i].cartViewTagFired !== undefined ? products[i].cartViewTagFired : false } }); } } // Save cart to the store so it can be loaded from other DOM instances. _saveCartToStore(); // Fire Shop Action 5 tag (aka: cartView) cartView(products); } /** * Takes the current digitalData.cart object and saves it to the store. * @private * @returns {void} */ var _saveCartToStore = function () { var cart = ddo.get('cart', {}); var store = new Store('cart'); var key = _getCartStoreKey(); store.set(key, cart); store.save(); } /** * Load the cart object from the store and if it's not empty, push it * into digitalData.cart. * @private * @returns {void} */ var _loadCartFromStore = function () { var store = new Store('cart'); var key = _getCartStoreKey(); var cart = store.get(key); if (!_isEmpty(cart)) ddo.set('cart', cart); } /** * Return a key for saving the cart to the store. If the first page in * the pageInfo array has an appName, use that as a key. Otherwise, use the * string 'noKey'. * @private * @returns {string} key */ var _getCartStoreKey = function () { return ddo.pageInfo.get('appName', 0, 'noKey'); } /** * Converts a given value to a lowercase string for comparison. * @private * @param {string|number|bool} value - Value you wish to convert to a lowercase string. * @returns {string} */ var _toLowerCaseString = function (value) { return (value + '').toLowerCase(); } /** * When assigning existing object to a variable, JavaScript passes a reference * to the original object. Thefore, if we want to modify the parameters without modifying * the underling properties of the orignial object, we need to create a clone * @private * @param {object|array} source - Object or array to create a clone of. * @returns {object|array} */ var _clone = function (source) { return JSON.parse(JSON.stringify(source)); } /** * Returns the value of a cookie found to match the provided name. * @private * @param {string} name - Unique name of the cookie. * @returns {string} */ var _readCookie = function (name) { var cookies = new Cookies(); return cookies.get(name); } // akr Can we remove this? /** * This function grabs the 'CM_CJUID' and 'CM_CJSID' cookies (MDA Coremetrics Parameters) if they exist * Or listens for the MDA_OTT_VALIDATED event and grab the cookies. * Then the cookies are set as 'segmentValue' properties within the DDO */ // var _setmdaCmParams = function () { // /* if cookies exists, set segmentValues */ // if (_readCookie("CM_CJUID") && _readCookie("CM_CJSID")) { // _setSegmentValue("cmcjuid", _readCookie("CM_CJUID")); // _setSegmentValue("cmcjsid", _readCookie("CM_CJSID")); // } else { // /* if cookies do not exist, add an event listener for MDA_OTT_VALIDATED*/ // document.addEventListener('MDA_OTT_VALIDATED', function () { // /* Set cookie values as segmentValues within the DDO */ // _setSegmentValue("cmcjuid", _readCookie("CM_CJUID")); // _setSegmentValue("cmcjsid", _readCookie("CM_CJSID")); // }) // } // } /** * Interact with the pageIDHistory array within the digitalData object. * @private * @requires digitalData.page.attributes.pageIDHistory * @param {string} command - The command you would like to perform against the * pageIDHistory. Supported values: add|prev|current * @param {number} [pageInfoArrayIndex=0] - Index of the pageInfo array from * digitalData.page.pageInfo[n] you are adding to the history. * @param {string} [pageID] - The full pageID you are adding to the history. * @returns {void|string} */ var _pageIDHistory = function (command, pageInfoArrayIndex, pageID) { if (!_isValidPageInfoArrayIndex(pageInfoArrayIndex, true)) pageInfoArrayIndex = 0; if (!pageID) pageID = ddo.pageInfo.get('pageID', pageInfoArrayIndex); var history = ddo.get('page.attributes.pageIDHistory', []); var lastIndex = history.length - 1; var add = function () { if (history.length === 0 || history[lastIndex].pageID.toLowerCase() !== pageID.toLowerCase()) { history.push({ 'pageInfoArrayIndex': pageInfoArrayIndex, 'pageID': pageID, 'timestamp': new Date().getTime() }); } }; var prev = function () { if (history.length > 1) { history.pop(); } return history[lastIndex - 1].pageID; } var current = function () { if (digitalData?.page?.attributes?.pageIDHistory?.length > 0) { return history[lastIndex].pageID } else { return digitalData?.page?.pageInfo?.[0]?.pageID } } var commands = { 'add': add, 'prev': prev, 'current': current } if (commands[command]) { return commands[command](); } } /** * Pushes a messages to the data collector array. * @private * @param {object} message - Object containing necessary properties for data collection. * @returns {void} */ var _pushToDataCollector = function (message) { win.dataCollector = win.dataCollector || []; _trigger('beforePushToDataCollector', message); win.dataCollector.push(message); _trigger('afterPushToDataCollector', message); } /** * Specify a function to execute when the DOM is fully loaded. * @public * @param {function} handler - A function to execute after the DOM is ready. * @returns {void} */ var _ready = function (handler) { if (isDOMReady && typeof handler === 'function') { handler(); } else { readyHandlers.push(handler); } } /** * Process handler functions in readyHandlers and execute. * @private * @returns {void} */ var _processReadyHandlers = function () { readyHandlers.forEach(function (handler) { if (typeof handler === 'function') handler(); }); readyHandlers = []; } /** * To be called when the DOM is ready. Sets the domReadyFired flag to true to * avoid duplicate execution of page load. Starts _onLoad() function. * @private * @returns {void} */ var _onDomReady = function () { if (!isDOMReady) { isDOMReady = true; _processReadyHandlers(); } } /** * To be called when DOMContentLoaded event is raised. Cleans up event listner * and starts _onDomReady() function. * @private * @returns {void} */ var _domLoadComplete = function () { doc.removeEventListener("DOMContentLoaded", _domLoadComplete); _onDomReady(); } /** * Stops further execution of Tealium utags by setting the noview flag in * utag_cfg_ovrd object. Sets utagLoadStopped flag to true. * @deprecated * @private * @requires utag * @returns {void} */ var _stopUtagLoad = function () { _log('utagLoadStopped: ' + utagLoadStopped, LOG_LEVEL.DEBUG); if (!utagLoadStopped) { _log('Stopping further utag loading.', LOG_LEVEL.INFO); utagLoadStopped = true; win.utag_cfg_ovrd = { noview: true }; } } /** * Uses Tealium's utag.view() to start the loading of one, multiple, or * all Tealium tags. If call loads all tags, utagLoadStopped flag will * be set to false. * @deprecated * @private * @requires utag * @param {number|array} [utagIds] - A single int or an array of int * indicating which utags to fire. If null, all tags will load. * @returns {void} */ var _loadUtags = function (utagIds) { if (utagIds) { utagIds = _asArray(utagIds); utag.view(utag_data, utagIds); _log('Loading utags:', utagIds, LOG_LEVEL.INFO); } else { utagLoadStopped = false; utag.view(utag_data); _log('Loading all utags.', LOG_LEVEL.INFO); } } /** * Determines if the provided value is a valid array index * of digitalData.page.pageInfo[n]. * @private * @param {number} pageInfoArrayIndex - Index of the pageInfo * array you'd like to determine if is valid. * @param {boolean} warnOff - flag on whether to suppress warnings * @returns {bool} */ var _isValidPageInfoArrayIndex = function (pageInfoArrayIndex, warnOff = false) { if (warnOff) return false; if (typeof pageInfoArrayIndex === 'undefined' || pageInfoArrayIndex === null || isNaN(pageInfoArrayIndex)) { _log('pageInfoArrayIndex provided is not a number. Defaulting to zero.', LOG_LEVEL.WARN); return false; } var pageInfo = ddo.get('page.pageInfo', []); if (pageInfoArrayIndex < 0 || pageInfoArrayIndex > pageInfo.length - 1) { _log('pageInfoArrayIndex provided is outside the bounds of the pageInfo array. Defaulting to zero.'); return false; } return true; } /** * Determines if the provided value is a valid array index * of digitalData.page.category.addlCategory[n]. * @private * @param {number} addlCategoryArrayIndex - Index of the addlCategory * array you'd like to determine if is valid. * @returns {bool} */ var _isValidAddlCategoryArrayIndex = function (addlCategoryArrayIndex) { if (typeof addlCategoryArrayIndex === 'undefined' || addlCategoryArrayIndex === null || isNaN(addlCategoryArrayIndex)) { _log('addlCategoryArrayIndex provided is not a number. Defaulting to zero.', LOG_LEVEL.WARN); return false; } var addlCategory = ddo.get('page.category.addlCategory', []); if (addlCategoryArrayIndex < 0 || addlCategoryArrayIndex > addlCategory.length - 1) { _log('addlCategoryArrayIndex provided is outside the bounds of the addlCategory array. Defaulting to zero.'); return false; } return true; } /** * Search through digitalData.page.pageInfo array for a specific pageID. * @private * @param {string} pageID - pageID we are searching for. Search is not case sensitive. * @returns {number} pageInfoArrayIndex */ var _findPageInfoArrayIndexByPageID = function (pageID) { return _findArrayIndexByProperty(ddo.get('page.pageInfo', []), 'pageID', pageID, true); } /** * Find the index of the array where a property on the objects * within the array equals a specified value. * @private * @param {array} array - Array of objects to search through. * @param {string} property - Property on object within array to match on. * @param {string|number|bool} value - Value we are searching for. * @param {bool} [looseMatch=false] - Strings case insensitive, other * matches are loose equality match. * @returns {number} arrayIndex */ var _findArrayIndexByProperty = function (array, property, value, looseMatch) { var properties = property.split('.'); var topPropertyName = properties[0]; var lowerPropertyName; for (var i = 0, len = array.length; i < len; i += 1) { var prop = array[i][topPropertyName]; if (!prop) array[i][topPropertyName] = []; for (var j = 1, propLen = properties.length; j < propLen; j++) { prop = prop[properties[j]]; if (!prop) break; } if (!looseMatch && prop === value) return i; else if (looseMatch && typeof value === 'string' && _trim(_toLowerCaseString(prop)) === _trim(_toLowerCaseString(value))) return i; else if (looseMatch && prop == value) return i; } return -1; } /** * Finds the pageID by a unique value in the Dynamic_PageView_Element lookup table and attempts to * match the pageID with one in digitalData.page.pageInfo[n]. If a match is found, returns the * array index, otherwise returns -1. Associated value search is not case sensitive. * @private * @requires utag_data.Dynamic_PageView_Element - Comma deliminated string of pageID-_-associatedValue pairs. * @param {string} value - Unique string to match within the lookup table found after the -_- seperator. * @returns {number} pageInfoArrayIndex */ var _findPageInfoArrayIndexByAssociatedValue = function (value) { if (!value) return -1; if (!utag_data.Dynamic_PageView_Element) return -1; var recordDelimiter = ','; var value = '-_-' + value.toLowerCase() + recordDelimiter; var utagLookupData = utag_data.Dynamic_PageView_Element.toLowerCase(); if (utagLookupData.slice(-1) !== recordDelimiter) utagLookupData += recordDelimiter; var pageID; var associatedValuePosition = utagLookupData.indexOf(value); if (associatedValuePosition > -1) { var startPosition = utagLookupData.lastIndexOf(recordDelimiter, associatedValuePosition) + 1; pageID = utag_data.Dynamic_PageView_Element.substring(startPosition, associatedValuePosition); } if (!pageID) return -1; return _findPageInfoArrayIndexByPageID(pageID); } /** * Takes any value, if it's already an array returns itself. Otherwise, returns an array with * the value being the item within the array. * @private * @param {any} value * @returns {array} */ var _asArray = function (value) { if (Array.isArray(value)) return value; return [value]; } /** * Trims the segmentWrapperChar and whitespace from the begging and end of the provided string. * @private * @param {string} s - String to sanatize. * @returns {string} value */ var _trim = function (s) { if (!s) return; if (s.length >= 1 && s[0] === segmentWrapperChar) s = s.slice(1); if (s.length >= 1 && s[s.length - 1] === segmentWrapperChar) s = s.slice(0, -1); return s.trim(); } /** * Check an object to see if it has any properties. * @param {object} obj - Object to to check if is empty. * @returns {boolean} */ function _isEmpty(obj) { // null and undefined are "empty" if (obj == null) return true; // Assume if it has a length property with a non-zero value // that that property is correct. if (obj.length > 0) return false; if (obj.length === 0) return true; // If it isn't an object at this point // it is empty, but it can't be anything *but* empty // Is it empty? Depends on your application. if (typeof obj !== "object") return true; // Otherwise, does it have any properties of its own? // Note that this doesn't handle // toString and valueOf enumeration bugs in IE < 9 for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) return false; } return true; } /** * Returns a the default value if no value is passed as the property. * @private * @param {*} _property * @param {*} _default * @returns {*} */ var _setDefault = function (_property, _default) { return (typeof _property === 'undefined' || _property === null) ? _default : _property; } /** * Returns the top level domain for the provided string. * Example: _tld('www.bankofamerica.com') will return 'bankofamerica.com' * @private * @param {string} d * @returns {string} */ var _tld = function (d) { d = d || win.location.hostname; var parts = d.split('.').reverse(); if (parts.length === 1) return parts[0]; if (parts.length > 2 && parts[1].length <= 3) { return parts.splice(0, 3).reverse().join('.'); } return parts.splice(0, 2).reverse().join('.'); } /** * Logs a deprecation warning to the console. * @private * @param {string} functionName - Name of the deprecated function called. * @param {string} [msg] - Additional message to log to the console. * @returns {void} */ var _deprecationWarning = function (functionName, msg) { _log('Deprecation warning: ' + functionName + ' is deprecated. ' + msg, LOG_LEVEL.WARN); } /** * Logs a message and/or an object to the console based on your log settings in _settings.logLevel * @private * @param {string|object} msg - Message to be logged to the console. * @param {object|array} [obj1] - Object to be logged to the console along side the message. * @param {number} [severity=1] - Severity level of the message. Determines which log type to send to console and when to log based on _settings.logLevel. * @returns {void} */ var _log = function (msg, obj1, severity) { if (!severity && typeof obj1 === 'number') { severity = obj1; obj1 = null; } else if (!severity) { severity = 1; } if (_settings.logLevel <= severity && typeof console !== "undefined") { var logType = LOG_LEVEL_STRINGS[severity]; if (typeof logType != "string") logType = "log"; if (console[logType]) { // if not defined, fallback to console.log() if (obj1) { console[logType](msg, obj1); } else { console[logType](msg); } } else if (console.log) { if (typeof obj1 === 'object') msg += '\n' + JSON.stringify(obj1, null, 2); console.log(logType.toUpperCase() + ": " + msg); } } } /** * Return a unified timestamp that takes into account the timezone offset. * @private * @returns {timestamp} */ var _timestamp = function () { var e = new Date; return e.getTime() - e.getTimezoneOffset() } /** * This function serves as an API to set application details in the digitalData object agnostically of data collection tool. * @param {object} payload contains the application details to be set in the ddo * @returns {void} */ var _setApplicationDetails = function (payload) { if (typeof payload !== 'object') { _log('Payload is not an object', LOG_LEVEL.ERROR); return; } if (!window.digitalData) { _log('digitalData object is not available', LOG_LEVEL.ERROR); return; } var cart = window.digitalData.cart || { cartID: '', applicationID: null, attributes: {}, item: [], fulfilmentID: null }; for (var prop in payload) { if (payload.hasOwnProperty(prop)) { if (cart.hasOwnProperty(prop)) { cart[prop] = payload[prop]; } } } window.digitalData.cart = cart; } /** * This function grabs the applicationID for credit card applications and adds it to the ddo * @returns {string} applicationID */ var _getApplicationId = function () { // grab applicationID from global scope if available if (window.cm) return window.cm.orderID; } /** * This function repeats in 100ms interval until it is able to set the celebrus content key in the ddo. * * @private * @requires ddo.user.sharedIDs to be defined * @returns {undefined} */ var getCelebrusContentKey = function () { if (ddo.get('user.sharedIDs') === null) { ddo.set('user.sharedIDs', {}); } var accessCelebrusContentKey = setInterval(function () { if (ddo.get('user.sharedIDs.celebrus') !== null) { return clearInterval(accessCelebrusContentKey); } if (win.celebruscontentKey) { ddo.set('user.sharedIDs.celebrus', win.celebruscontentKey); _trigger('celebrusContentKeyAvailable'); } }, 100); }; /** * Take a URI value and decompose it returning an object with the individual pieces * as a set of key/value pairs. * * @private * @param {*} uri * @returns {object} */ var decomposeUri = function (uri) { var a = doc.createElement('a'); a.href = uri || doc.referrer; var pathname = a.pathname.replace(/^\//, ''); // Normalize initial slash, i.e., IE6 'search' vs Chrome '/search' return { url: a.host + '/' + pathname, hash: a.hash, host: a.host, hostname: a.hostname, pathname: pathname, protocol: a.protocol, uriParams: (function (retVal, s) { if (s !== "") { polyfills.array.map(s.split('&'), function (elem) { var k = elem.split('='); retVal[k.shift()] = k.shift(); }); return retVal; } else return ''; }({}, a.search.replace(/^(\/|\?)?|\/$/g, ''))) // Remove leading ? from query string value }; } // here lies eventify, a good idea well executed, but an incomplete solution. /** * setting a mutation observer on the head element for third party scripts * once we know a script is ready we can execute subsequent methods * ex: bactm.scriptReady('thirdPartyVendor', { childList: true }, callbackMethod) * @param {string} src * @param {object} options * @callback runFunction */ const _scriptReady = (src, options = { childList: true }, runFunction = () => {}) => { const observingHead = new MutationObserver(function(mutationList, observer) { const vendorScript = document.querySelector(`script[src*="${src}"]`); if (vendorScript && vendorScript.src && vendorScript.src.includes(src)) { runFunction() observer.disconnect(); } }) const head = document.querySelector("head"); observingHead.observe(head, options) } // =========================================================================== // End helper functions. // =========================================================================== // =========================================================================== // Trigger & Listener functions. // =========================================================================== var _listener = function (eventKey, listener) { var isListenerQueued = queuedEvents.hasOwnProperty(eventKey); // if the event was queued, fire the listener with the queued info if (isListenerQueued) { queuedEvents[eventKey] = queuedEvents[eventKey] || []; queuedEvents[eventKey].forEach(function (info) { listener(typeof info !== 'undefined' ? info : {}); }); delete queuedEvents[eventKey]; } // Create the event's object if not yet created. publishedEvents[eventKey] = publishedEvents[eventKey] || []; // Add the listener to the queue var index = publishedEvents[eventKey].push(listener) - 1; return { remove: function () { delete publishedEvents[eventKey][index]; } } } var _trigger = function (eventKey, info) { // If the event doesn't exist then there are no listeners in the queue, just leave. var isListenerRegistered = publishedEvents.hasOwnProperty(eventKey); var isListenerQueued = queuedEvents.hasOwnProperty(eventKey); // if a listener is not registered, check if it has been queued. // if it hasn't then queue it and leave. if (!isListenerRegistered) { if (isListenerQueued) return; queuedEvents[eventKey] = queuedEvents[eventKey] || []; info = info || {}; return queuedEvents[eventKey].push(info); } // if the listener is registered and still in the queue, delete it from the queue if (isListenerQueued) delete queuedEvents[eventKey]; // Cycle through the published events queue and fire listeners. publishedEvents[eventKey].forEach(function (listener) { listener(typeof info !== 'undefined' ? info : {}); }); } // =========================================================================== // End Triggers & Listener functions. // =========================================================================== // =========================================================================== // dataCollector Queue functions. // =========================================================================== var _dataCollectorHelper = function (dataCollector, listener, listenToPast) { this._dataCollector = dataCollector; this._listener = listener || function () { }; this._executingListener = false; this._unprocessed = []; var oldPush = dataCollector.push; var that = this; dataCollector.push = function () { var messages = [].slice.call(arguments, 0); var result = oldPush.apply(dataCollector, messages); var event = new Event('dataCollector-update'); that._processMessages(messages); document.dispatchEvent(event); return result; } this._processMessages(dataCollector, !listenToPast); } // win['dataCollectorHelper'] = _dataCollectorHelper; _dataCollectorHelper.prototype._processMessages = function (messages, skipListener) { this._unprocessed.push.apply(this._unprocessed, messages); while (this._executingListener === false && this._unprocessed.length > 0) { var update = this._unprocessed.shift(); if (!skipListener) { this._executingListener = true; this._listener(update); this._executingListener = false; } } } // =========================================================================== // End dataCollector Queue functions. // =========================================================================== // =========================================================================== // digitalData Object - Getter and Setter functions. // =========================================================================== var ddo = {}; /** * Returns the value within the digitalData object. If a portion of the path doesn't exist, * return the defaultValue. * * @public * @param {string} key - The path of the property to return. * @param {*} (defaultValue=null) - The value to return if the property isn't set. * @returns {*} value. */ ddo.get = function (key, defaultValue) { if (typeof key !== 'string') throw new TypeError('Key must be a dot seperated string.'); defaultValue = typeof defaultValue === 'undefined' ? null : defaultValue; var tree = key.split('.'); var base = window.digitalData || {}; for (var i = 0, len = tree.length; i < len; i++) { var propKey = tree[i]; // See if we are referencing an array in the path. var arrInd = propKey.indexOf('['); if (arrInd > -1) { // Get the name portion of the array we are referencing. var arrPropKey = propKey.substring(0, arrInd); if (!Array.isArray(base[arrPropKey]) || base[arrPropKey].length === 0) return defaultValue; // Get the index value of the array we are referencing. var index = propKey.substring(arrInd + 1, propKey.length - 1); if (isNaN(index)) return defaultValue; // If the index it outside the bounds of the array, return the defaultValue. if (index < 0 || index >= base[arrPropKey].length) return defaultValue; // If this is the last property in the path, return the value. if (i === len - 1) return base[arrPropKey][index]; // Set our base and continue on in the path. base = base[arrPropKey][index]; continue; } // Check if the property exists. var baseHasProperty = base.hasOwnProperty(propKey); // If the property in the path exists, and we have further to go // in our path, set the base and continue on in the path. if (baseHasProperty && i < len - 1) { base = base[propKey]; continue; } // If the property exists, return the value. Otherwise return the defaultValue. return baseHasProperty ? base[propKey] : defaultValue; } } /** * Sets the value within the digitalData object. If a portion of the path doesn't exist, * it's created. * * @public * @param {string} key - The path of the property to set. * @param {*} value - The value to set. * @returns {*} value. */ ddo.set = function (key, value) { if (typeof key !== 'string') throw new TypeError('Key must be a dot seperated string.'); if (typeof value === 'undefined') throw new TypeError('A value must be provided.'); var tree = key.split('.'); var base = window.digitalData || {}; if (key === 'user.glancePartyID') _trigger('vendor:glance:auth', value) for (var i = 0, len = tree.length; i < len; i++) { var propKey = tree[i]; // See if we are referencing an array in the path. var arrInd = propKey.indexOf('['); if (arrInd > -1) { // Get the name portion of the array we are referencing. var arrPropKey = propKey.substring(0, arrInd); if (!Array.isArray(base[arrPropKey]) && typeof base[arrPropKey] !== 'undefined') throw new TypeError('You referenced an array index but the property ' + arrPropKey + ' is not an array.'); // Get the index value of the array we are referencing. var index = parseInt(propKey.substring(arrInd + 1, propKey.length - 1)); if (isNaN(index)) throw new TypeError('The array index must be a number.'); // Get the array and check its length. base[arrPropKey] = base[arrPropKey] || []; var baseLen = base[arrPropKey].length; // If the index it outside the bounds of the array, throw an error. if (index !== 0 && (index < 0 || index > baseLen)) throw new RangeError('Trying to save to an index outside the range of the array.'); // Check if we are at the end of the path. if (i === len - 1) { // The index requested is one greater than the current length. // In this case, we can go ahead and push the value onto the end. if (index === baseLen) { base[arrPropKey].push(value); return value; } // We are within the bounds of the array and at the end of the // path, so set the value against the array index provided. base[arrPropKey][index] = value; return value; }; // The index requested is one greater than the current length. // In this case, we can go ahead and push a blank object onto the end. if (index === baseLen) base[arrPropKey].push({}); // We aren't at the end of the path, so we know to set the a property // on the index provided, there needs to be an object there. if (typeof base[arrPropKey][index] !== 'object') throw new TypeError('Cannot write to a non-object property.'); // Set our base and continue on in the path. base = base[arrPropKey][index]; continue; } // Check if we are at the end of the path. if (i === len - 1) { // We are at the end of the path, but we cannot set a property on a non-object. if (typeof base !== 'object') throw new TypeError('Cannot write to a non-object property.'); // We can set the value and get out of here. base[propKey] = value; return value; } // Set our base and continue on in the path. base[propKey] = base[propKey] || {}; base = base[propKey]; } } // Shortcuts for working with the pageInfo object. ddo.pageInfo = {}; /** * Shortcut to retrieve pageInfo properties from within the digitalData.page.pageInfo array. * * @public * @param {string} key - The path of the property to return. * @param {string} [index=0] - The pageInfo array index. * @param {*} [defaultValue=null] - The value to return if the property isn't set. * @returns {*} value. */ ddo.pageInfo.get = function (key, index, defaultValue) { return ddo.get('page.pageInfo[' + (index || 0) + ']' + (key ? ('.' + key) : ''), defaultValue); } /** * Shortcut to set the value within the digitalData.page.pageInfo object. If a portion of * the path doesn't exist, it's created. * * @public * @param {string} key - The path of the property to set. * @param {*} value - The value to set. * @param {number} [index=0] - The pageInfo array index. * @returns {*} value. */ ddo.pageInfo.set = function (key, value, index) { if (typeof value === 'undefined') { value = key; key = null; } return ddo.set('page.pageInfo[' + (index || 0) + ']' + (key ? ('.' + key) : ''), value); } // =========================================================================== // End digitalData Object - Getter and Setter functions. // =========================================================================== // =========================================================================== // SudoPromise API functions. // =========================================================================== var SudoPromise = function (cb) { var self = this , _state = 0 , _result = null , _deferred = null; self._onResolved = null; self._onRejected = null; var resolve = function (result) { if (_state !== 0) return; _state = 1; _result = result; if (_deferred) self.handle(_deferred); } var reject = function (reason) { if (_state !== 0) return; _state = 2; _result = reason; if (_deferred) self.handle(_deferred); } self.handle = function (handler) { if (_state === 0) { _deferred = handler; return; } if (_state === 1) { handler.onResolve(_result); _deferred = null; } else if (_state === 2 && handler.onRejection) { handler.onRejection(_result); _deferred = null; } } cb(resolve, reject); }; SudoPromise.prototype.then = function (onResolve, onRejection) { var self = this; if (onResolve) self._onResolved = onResolve; if (onRejection) self._onRejected = onRejection; self.handle({ onResolve: self._onResolved, onRejection: self._onRejected }); return self; } SudoPromise.prototype.catch = function (onRejection) { this.then(null, onRejection); } // =========================================================================== // End SudoPromise API functions. // =========================================================================== // =========================================================================== // AJAX API functions. // =========================================================================== var Ajax = function () { if (!(this instanceof Ajax)) return new Ajax(); } Ajax.prototype.xhr = function (opt) { return new _ajaxHelpers.Promise(function (resolve, reject) { try { var url, params = opt.data || null; if (typeof opt === 'string') url = opt; if (!opt) opt = {}; var method = opt.method || 'GET'; url = url || opt.url || ''; var async = (typeof opt.sync !== 'undefined') ? !opt.sync : true; if (!url) throw 'A URL is required.'; var xhr = new XMLHttpRequest(); xhr.open(method, url, async, opt.user, opt.password); if (opt.contentType === 'json') xhr.setRequestHeader("Content-Type", "application/json"); if (opt.data && ((!opt.contentType && typeof opt.data !== 'string') || opt.contentType === 'json')) params = JSON.stringify(opt.data); if (opt.withCredentials) xhr.withCredentials = true; if (opt.headers) { for (key in opt.headers) { xhr.setRequestHeader(key, opt.headers[key]); } } xhr.onerror = function () { reject('Uncaught AJAX error raised. Check the URL.'); } xhr.onload = function () { if (xhr.status === 200) resolve(xhr.responseText); else reject('Request failed. Returned status of ' + xhr.status); } xhr.send(params); } catch (e) { reject(e); reportError(e); } }); } Ajax.prototype.jsonp = function (url, jsonp, cb) { var body = doc.body || doc.getElementsByTagName('body')[0]; win[jsonp] = function (data) { delete win[jsonp]; body.removeChild(script); cb(data); }; var script = doc.createElement('script'); script.src = url + (url.indexOf('?') >= 0 ? '&' : '?') + 'callback=' + jsonp; body.appendChild(script); } Ajax.prototype.post = function (url, data, opt) { var postOpts = { method: 'POST' , url: url , data: data }; polyfills.object.assign(postOpts, opt); return this.xhr(postOpts); } Ajax.prototype.get = function (url, opt) { var getOpts = { method: 'GET' , url: url }; polyfills.object.assign(getOpts, opt); return this.xhr(getOpts); } // =========================================================================== // End AJAX API functions. // =========================================================================== // =========================================================================== // AJAX helper functions. // =========================================================================== var _ajaxHelpers = {}; if (typeof Promise === 'function') _ajaxHelpers.Promise = Promise; else _ajaxHelpers.Promise = SudoPromise; // =========================================================================== // End AJAX helper functions. // =========================================================================== // =========================================================================== // Store API functions. // =========================================================================== var Store = function (key, config) { if (!(this instanceof Store)) return new Store(key, config); this._config = (config && typeof config !== 'boolean') ? config : {}; this._key = key; this._store = {}; // Making this backwards compatible for when second argument was useLocalStorage bool. if (!config || typeof config === 'boolean') { this._config.type = config ? 'localStorage' : 'sessionStorage'; } if (key) return this.load(key, config); } Store.prototype.load = function (key, config) { if (typeof key !== 'string') return this; this._key = key; config = config || {}; if (config.type) this._config.type = _setDefault(config.type, 'sessionStorage'); var cmdKey = _storeHelpers.cmds[this._config.type]; this._helpers = _storeHelpers[cmdKey](this._config); this._store = this._helpers.load(key); return this; } Store.prototype.all = function () { return this._store; } Store.prototype.get = function (key) { if (typeof key !== 'string' || !this._store[key]) return null; return this._store[key]; } Store.prototype.set = function (key, value) { if (typeof key !== 'string' || typeof value === 'undefined') return; this._store[key] = value; } Store.prototype.remove = function (key) { if (typeof key !== 'string') return; delete this._store[key]; } Store.prototype.save = function (key) { var _saveKey = key || this._key; if (typeof _saveKey !== 'string') { _log('Invalid storage key provided. Unable to save to ' + this._config.type + '.', LOG_LEVEL.WARN); return; }; try { this._helpers.save(_saveKey, this._store); if (key) this._key = key; } catch (e) { _log('Unable to save to ' + this._config.type + '.', LOG_LEVEL.WARN); reportError(e); } } Store.prototype.clear = function () { this._store = {}; this.save(); } Store.prototype.delete = function () { try { this._helpers.save(this._key, null); this._store = {}; } catch (e) { _log('Unable to remove ' + this._config.type + ' item.', LOG_LEVEL.WARN); reportError(e); } } // =========================================================================== // End Store API functions. // =========================================================================== // =========================================================================== // Store API helper functions. // =========================================================================== var _storeHelpers = {}; _storeHelpers.cmds = { 'sessionStorage': 'storage' , 'localStorage': 'storage' , 'sessionCookie': 'cookie' , 'cookie': 'cookie' } _storeHelpers.cookie = function (config) { var _cookieName = 'bactm' , _cookieConfig = { domain: _tld() }; config = config || {}; if (config.type && typeof config.type === 'string' && config.type.indexOf('session') === -1 ) { _cookieName = 'bactm_lts'; _cookieConfig['expires'] = 365; _cookieConfig['sameSite'] = 'none'; _cookieConfig['secure'] = true; } var _cookies = new Cookies() , _bactmCookie = _cookies.getJSON(_cookieName) || {}; var _load = function (key) { return _bactmCookie[key] || {}; } var _save = function (key, value) { _cookies._refresh(); if (value === null) delete _bactmCookie[key]; else _bactmCookie[key] = value; _cookies.set(_cookieName, _bactmCookie, _cookieConfig); } return { load: _load , save: _save } } _storeHelpers.storage = function (config) { var _storage = window[config.type]; var isJSONString = function (str) { try { JSON.parse(str); } catch (e) { return false; } return true; } var _load = function (key) { var _data; try { _data = isJSONString(_storage.getItem(storageKeyPrefix + key)) ? JSON.parse(_storage.getItem(storageKeyPrefix + key)) : _storage.getItem(storageKeyPrefix + key); } catch (e) { // _log('Unable to read from ' + config.type + '.', LOG_LEVEL.WARN); console.log('Unable to read from ' + config.type + '.'); reportError(e); } return _data || {}; } var _save = function (key, value) { var _storageKey = storageKeyPrefix + key; if (value === null) _storage.removeItem(_storageKey); else _storage.setItem(_storageKey, JSON.stringify(value)); } return { load: _load , save: _save } } // =========================================================================== // End Store API helper functions. // =========================================================================== // =========================================================================== // Cookies API functions. // =========================================================================== var Cookies = function () { if (!(this instanceof Cookies)) return new Cookies(); var self = this; self._refresh = function () { self._cookies = doc.cookie ? doc.cookie.split('; ') : []; self._cookieCache = {}; } self._refresh(); } Cookies.prototype.set = function (key, value, options) { if (!key) return; var options = options || {}; options['path'] = options.path || '/'; if (typeof options.expires === 'number') { var expires = new Date(); expires.setMilliseconds(expires.getMilliseconds() + options.expires * 864e+5); options.expires = expires; } else if (typeof options.expires === 'string') { try { var expires = new Date(Date.parse(options.expires)); options.expires = expires; } catch (e) { reportError(e); delete options.expires; } } // We're using "expires" because "max-age" is not supported by IE options.expires = options.expires ? options.expires.toUTCString() : ''; var rawKey = key; key = encodeURIComponent(String(key)); try { result = JSON.stringify(value); if (/^[\{\[]/.test(result)) { value = encodeURIComponent(result); } } catch (e) { } var stringifiedAttributes = ''; for (var attributeName in options) { if (!options[attributeName]) { continue; } stringifiedAttributes += '; ' + attributeName; if (options[attributeName] === true) { continue; } stringifiedAttributes += '=' + options[attributeName]; } this._cookieCache[rawKey] = value; return (doc.cookie = key + '=' + value + stringifiedAttributes); } Cookies.prototype.get = function (key, options) { var result , options = options || {} , rdecode = /(%[0-9A-Z]{2})+/g; if (!key || options.bustCache) this._refresh(); if (this._cookieCache[key]) return this._cookieCache[key]; if (!key) result = {}; for (var i = 0; i < this._cookies.length; i++) { var parts = this._cookies[i].split('=') , cookie = parts.slice(1).join('='); if (cookie.charAt(0) === '"') { cookie = cookie.slice(1, -1); } try { var name = parts[0].replace(rdecode, decodeURIComponent); cookie = cookie.replace(rdecode, decodeURIComponent); if (options.json) { try { cookie = JSON.parse(decodeURIComponent(cookie)); } catch (e) { } } if (key === name) { result = cookie; this._cookieCache[name] = cookie; break; } if (!key) { result[name] = cookie; this._cookieCache[name] = cookie; } } catch (e) { } } return result; } Cookies.prototype.getJSON = function (key) { return this.get(key, { bustCache: true, json: true }); } Cookies.prototype.remove = function (key) { if (this._cookieCache[key]) delete this._cookieCache[key]; this.set(key, '', { expires: -1 }); } // =========================================================================== // End Cookies API functions. // =========================================================================== // =========================================================================== // QueryString API functions. // =========================================================================== var QueryString = function (uri) { if (!(this instanceof QueryString)) return new QueryString(uri); if (!uri && uri !== '') uri = window.location.href; var startIndex = uri.indexOf('?') , endIndex = uri.indexOf('#') , start = startIndex > -1 ? startIndex + 1 : 0 , end = endIndex > -1 ? endIndex : uri.length , parts = uri.substring(start, end).split('&') , storage = {}; if (startIndex > -1) { for (var i = 0, len = parts.length; i < len; i++) { var thisOne = parts[i].split('=') , name = thisOne[0] , value = thisOne.length > 1 ? thisOne[1] : ''; storage[name] = value; } } this._cache = storage; } QueryString.prototype.get = function (key) { return this._cache[key]; } QueryString.prototype.set = function (key, value) { if (!key) return; this._cache[key] = value; } QueryString.prototype.load = function (keyVal) { if (typeof keyVal !== 'object') return; for (key in keyVal) { if (keyVal.hasOwnProperty(key)) this.set(key, keyVal[key]); } } QueryString.prototype.toString = function () { var builder = []; for (key in this._cache) { if (this._cache.hasOwnProperty(key)) { builder.push(key + '=' + encodeURIComponent(this._cache[key])); } } return builder.join('&'); } // =========================================================================== // End QueryString API functions. // =========================================================================== // =========================================================================== // PixelTag API functions. // =========================================================================== var PixelTag = function (url, id) { // cannot continue if no URL is provided. if (!url) return; if (!(this instanceof PixelTag)) return new PixelTag(url); var img = doc.createElement('img'); img.src = url; img.style = 'display:none;position:absolute;'; img.width = 0; img.style.width = 0; img.height = 0; img.style.height = 0; img.alt = "Marketing Pixel"; img.setAttribute('aria-hidden', true); if (typeof id === 'string') img.id = id; this._img = img; } PixelTag.prototype.appendTo = function (parent) { if (!parent.appendChild) return; parent.appendChild(this._img); } PixelTag.prototype.appendToBody = function () { var body = doc.body || doc.getElementsByTagName('body')[0]; this.appendTo(body); } // =========================================================================== // End PixelTag API functions. // =========================================================================== // =========================================================================== // Polyfills // =========================================================================== /** * Due to some bad coding practice at BAC, true polyfills have adverse effects * on other's code, particularly in some Borneo sites. Once Borneo support is * no longer required, the following can be replaced. */ var polyfills = { object: {} , array: {} , string: {} }; polyfills.object.assign = Object.assign; if (typeof polyfills.object.assign != 'function') { polyfills.object.assign = function (target, varArgs) { // .length of function is 2 'use strict'; if (target == null) { // TypeError if undefined or null throw new TypeError('Cannot convert undefined or null to object'); } var to = Object(target); for (var index = 1; index < arguments.length; index++) { var nextSource = arguments[index]; if (nextSource != null) { // Skip over if undefined or null for (var nextKey in nextSource) { // Avoid bugs when hasOwnProperty is shadowed if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { to[nextKey] = nextSource[nextKey]; } } } } return to; }; } polyfills.array.find = function (ourArray, predicate) { if (ourArray.find) return ourArray.find(predicate); if (ourArray == null) { throw new TypeError('array.find called on null or undefined'); } if (typeof predicate !== 'function') { throw new TypeError('predicate must be a function'); } var list = Object(ourArray); var length = list.length >>> 0; var thisArg = arguments[1]; var value; for (var i = 0; i < length; i++) { value = list[i]; if (predicate.call(thisArg, value, i, list)) { return value; } } return undefined; } polyfills.array.map = function (arr, fun) { if (arr.map) return arr.map(fun); // Adapted from MDN if (arr === void 0 || arr === null) { throw new TypeError(); } var t = Object(arr); var len = t.length >>> 0; if (typeof fun !== 'function') { throw new TypeError(); } var res = new Array(len); var thisp = arguments[1]; for (var i = 0; i < len; i++) { if (i in t) { res[i] = fun.call(thisp, t[i], i, t); } } return res; } /** * Array.from polyfill adapted from MDN */ polyfills.array.from = function (arrayLike) { if (Array.from) return Array.from(arrayLike); var toStr = Object.prototype.toString; var maxSafeInteger = Math.pow(2, 53) - 1; var items = Object(arrayLike); var C = this; var T; var isCallable = function (fn) { return typeof fn === 'function' || toStr.call(fn) === '[object Function]'; }; var toInteger = function (value) { var number = Number(value); if (isNaN(number)) return 0; if (number === 0 || !isFinite(number)) return number; return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number)); }; var toLength = function (value) { var len = toInteger(value); return Math.min(Math.max(len, 0), maxSafeInteger); }; if (arrayLike == null) { throw new TypeError('Array.from requires an array-like object - not null or undefined'); } var mapFn = arguments.length > 1 ? arguments[1] : void undefined; if (typeof mapFn !== 'undefined') { if (!isCallable(mapFn)) { throw new TypeError('Array.from: when provided, the second argument must be a function'); } if (arguments.length > 2) { T = arguments[2]; } } var len = toLength(items.length); var A = isCallable(C) ? Object(new C(len)) : new Array(len); var k = 0; var kValue; while (k < len) { kValue = items[k]; if (mapFn) { A[k] = typeof T === 'undefined' ? mapFn(kValue, k) : mapFn.call(T, kValue, k); } else { A[k] = kValue; } k += 1; } A.length = len; return A; } /** * String.includes polyfill adapted from MDN */ polyfills.string.includes = function (haystack, search, start) { if (typeof start !== 'number') start = 0; if (haystack.includes) return haystack.includes(search, start); return (start + search.length > haystack.length) ? false : haystack.toString().indexOf(search, start) !== -1; } /** * Nested object property existence check polyfill adapted from: * https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_get */ polyfills.object.exists = function (obj, path, defaultValue) { function travel(regexp) { return String.prototype.split.call(path, regexp).filter(Boolean).reduce(function (res, key) { return res !== null && res !== undefined ? res[key] : res; }, obj); }; var result = travel(/[,[\]]+?/) || travel(/[,[\].]+?/); return result === undefined || result === obj || result === null ? defaultValue : true; } // =========================================================================== // End Polyfills // =========================================================================== // =========================================================================== // customEvents functions. // =========================================================================== var _raiseCustomEvent = function (eventKey, details) { _pushToDataCollector({ event: 'customEvent', eventKey: eventKey, options: details }); } // =========================================================================== // End customEvents functions. // =========================================================================== // =========================================================================== // Log beacon functions. // =========================================================================== var _getBaseUrl = function () { if (doc.baseURI) return doc.baseURI; var pathArray = location.href.split('/') , protocol = pathArray[0] , host = pathArray[2] , url = protocol + '//' + host + '/'; return url; } var _getBeaconUrl = function () { var base = _getBaseUrl() , splunkLogTransportUrl = env === 'prod' || base.indexOf('localhost') > -1 ? 'https://www.bankofamerica.com/content/images/ContextualSiteGraphics/bactm/bactm-transport.gif' : base + 'content/images/ContextualSiteGraphics/bactm/bactm-transport.gif' , baseUrl = splunkLogTransportUrl + '?d=' , q = []; for (var i = 0, len = logQ.length; i < len; i++) { var d = []; if (!Array.isArray(logQ[i] || typeof logQ[i] === 'object')) { for (var key in logQ[i]) { d.push(encodeURIComponent(key) + '~' + encodeURIComponent(logQ[i][key])); } } if (d.length > 0) q.push(d.join('~~')); } if (q.length > 0) return baseUrl + q.join('-_-'); else return baseUrl; } var _sendLogBeacon = function () { if (logQ.length > 0) { var _url = _getBeaconUrl(); if (navigator && typeof navigator.sendBeacon === 'function') { navigator.sendBeacon(_url); } else { var client = new XMLHttpRequest(); client.open("POST", _url, false); // third parameter indicates sync xhr client.setRequestHeader("Content-Type", "text/plain;charset=UTF-8"); client.send(); } } } // =========================================================================== // End log beacon functions. // =========================================================================== // =========================================================================== // Translation functions to support legacy bactm_ functions. // =========================================================================== /** * Deprecated function for calling a pageview. * @public * @deprecated * @param {number} [pageInfoArrayIndex=0] - Index of the pageInfo array from digitalData.page.pageInfo[n] you'd call a pageview for. * @returns {void} */ var _beginDataCollection = function (pageInfoArrayIndex) { _deprecationWarning('bactm_beginDataCollection', 'Consider using bactm.pageview() instead.'); if (!_isValidPageInfoArrayIndex(pageInfoArrayIndex)) pageInfoArrayIndex = 0; pageview(pageInfoArrayIndex); } /** * Deprecated function for calling a pageview. * @public * @deprecated * @param {number} [pageInfoArrayIndex=0] - Index of the pageInfo array from * digitalData.page.pageInfo[n] you'd call a pageview for. * @returns {void} */ var _capturePageview = function (pageInfoArrayIndex) { _deprecationWarning('bactm_capturePageview', 'Consider using bactm.pageview() instead.'); if (!_isValidPageInfoArrayIndex(pageInfoArrayIndex)) pageInfoArrayIndex = 0; pageview(pageInfoArrayIndex); } /** * Deprecated function for calling a productview. * @public * @deprecated * @returns {void} */ var _bactmProductView = function () { _deprecationWarning('bactm_productView', 'Consider using bactm.productview() instead.'); productview(); } /** * Deprecated function for calling a pageview. * @public * @deprecated * @param {number} [pageInfoArrayIndex=0] - Index of the pageInfo array from * digitalData.page.pageInfo[n] you'd call a pageview for. * @param {boolean} [useSecondaryCategory] - Determine if to use * digitalData.page.category.addlCategory instead of primaryCategory. * @param {array} [segments] - Additional segments to be added to the pageview call. * @returns {void} */ var _captureAdditionalPageview = function (pageInfoArrayIndex, useSecondaryCategory, segments) { _deprecationWarning('bactm_captureAddlPageview', 'Consider using bactm.pageview() instead.'); if (!_isValidPageInfoArrayIndex(pageInfoArrayIndex)) pageInfoArrayIndex = 0; var options = {}; options['categoryType'] = !useSecondaryCategory ? 'primary' : 'additional'; if (segments) options['segments'] = segments; pageview(pageInfoArrayIndex, options); } /** * Deprecated function for calling a pageview. * @public * @deprecated * @param {string} associatedValue - Unique key to match key in lookup table * to find the pageID for this pageview call. * @returns {void} */ var _captureDynamicPageview = function (associatedValue) { _deprecationWarning('bactm_captureDynamicPageview', 'Consider using bactm.pageview(associatedValue, { lookupType: \'associatedValue\' }) instead.'); pageview(associatedValue, { lookupType: 'associatedValue' }); } /** * Deprecated function no longer has any functional use as data collection * libraries now load asynchronously via tag manager. * @public * @deprecated * @returns {void} */ var _loadDataCollection = function () { _deprecationWarning('bactm_loadDataCollection', 'Data collection libraries are now loaded asynchronously via tag manager.'); } /** * Deprecated function to add products to the DDO without needing to manage the DDO structure. * Does not add if we find a product with a matching product ID already in the DDO. * @public * @param {string|number} productID - Unique identifier for the product. * @param {string} productName - Friendly name of the product. * @param {string} productCategory - Category product belongs to. * @returns {void} */ var _bactmAddProducts = function (productID, productName, productCategory) { _deprecationWarning('bactm_addProducts', 'Consider using bactm.addProducts() instead.'); var product = { 'productID': productID , 'productName': productName , 'productCategory': productCategory }; addProducts([product]); } /** * Deprecated function that takes a segment string or array of segment strings and adds them to the * digitalData.page.pageInfo[n].segmentValue. If segment already exists, updates the value. * * If digitalData.disable_pageviewonload is true, go ahead and call a pageview with this page. * Support temporarily added to call pageview if utag_data.cm_Segmentation_Value is true. * @public * @param {string|array} segmentValues - Array of or single key/value string(s) seperated by an underscore (e.g.: ['olbc_Y', 'st_NC'], 'olbc_N'). * @param {number} [pageInfoArrayIndex=0] - Index of the pageInfo array from digitalData.page.pageInfo[n] you'd like the get the segment values from. * @returns {void} */ var _bactmAddSegmentationValues = function (segmentValues, pageInfoArrayIndex) { _deprecationWarning('bactm_addSegmentationValues', 'Consider using bactm.addManySegmentValues() or pageview() instead.'); addManySegmentValues(segmentValues, pageInfoArrayIndex); if ((typeof utag_data !== 'undefined' && _toLowerCaseString(utag_data.cm_Segmentation_Value) === "true") || _toLowerCaseString(ddo.get('disable_pageviewonload')) === 'true') { pageview(pageInfoArrayIndex); } } // =========================================================================== // End Translation functions. // =========================================================================== // =========================================================================== // Public functions. // =========================================================================== /** * Captures data from digitalData object to call a Coremetrics pageview and adds * to the dataCollector queue for processing. * * Captures data from digitalData object found by pageInfo array index, pageID, * or a unique associated value. * * Options object allows for selecting pageInfo lookupType, adding segments, * choosing which category to use from the digitalData object, and indicating if * this is an app pageview requiring dynamic pageID. * * Usage: bactm.pageview(5, { segments: ['olbc_N', 'st_NC'], categoryType: 'primary' }); * Usage: bactm.pageview('this_is:my:PageID'); * Usage: bactm.pageview('this_is:my:PageID', { lookupType: 'pageID' }); * Usage: bactm.pageview('SomeValue', { lookupType: 'associatedValue' }); * Usage: bactm.pageview(2, { isApp: true }); * Usage: bactm.pageview(); * * Pageview calls with the options.isApp property set to true will process any * conversion events setup in utag_data.App_Conversion_Settings lookup table. * * @public * @param {string|number} [pageInfoKey] - Value indicating how to find the pageInfo * from the digitalData object. Can be the index of the array, pageID, or the * associated value. * @param {object} [options] - Object of options for this pageview call. Valid * properties include segmentValues {array}, categoryType {string}, lookupType {string}, * isSaveAndReturn {bool}, saveAndReturnId {string}, applicationId {string} * cartProducts {array} and isApp {bool}. * @returns {void} */ var pageview = function (pageInfoKey, options) { _log('Pageview event added to the dataCollector.', LOG_LEVEL.DEBUG); try { if (pageInfoKey !== undefined && typeof pageInfoKey !== 'string' && digitalData && digitalData.page && digitalData.page.pageInfo && modals.indexOf(digitalData.page.pageInfo[pageInfoKey].pageID) > -1) { if (options === undefined) options = {}; options.isModal = true; } _pushToDataCollector({ 'event': 'pageview', 'pageInfoKey': pageInfoKey, 'options': options }); } catch (error) { console.log('bactm.pageview error: ', error); reportError(error, { record: true }) } }; /** * Push productview to dataCollector * @public * @returns {void} */ var productview = function () { _log('Productview event added to the dataCollector.', LOG_LEVEL.DEBUG); const getDDOproduct = ddo.get('product', []); const products = getDDOproduct.filter(product => _toLowerCaseString(product.attributes.productviewTagFired) !== 'true'); if (products.length > 0) { _pushToDataCollector({ 'event': 'productview', data: { products: products } }); } } /** * Captures all products out of the digitalData.cart.item array and fires a Coremetrics * Shop Action 5 tag for each one where cartViewTagFired property is false. Once tag has * fired, cartViewTagFired property is set to true, ensuring duplicate Shop Action 5 tags * are not fired for a single product. * @public * @returns {void} */ var cartView = function (products) { // Grab products in cart to update cartViewTagFired property const ddoProducts = ddo.get('cart.item', []) const productsToFire = [] // Iterating over products for (let i = 0, productsLen = products.length; i < productsLen; i++) { // Conditional to filter out products which have already been fired if (_toLowerCaseString(products[i].cartViewTagFired) === 'false') { productsToFire.push(products[i]) // If the product is in the ddo.cart.item aray - update cartViewTagFired property const ddoMatch = ddoProducts.find(product => product.productInfo.productID === products[i].productID); if (ddoMatch) ddoMatch.attributes.cartViewTagFired = true; // Accounting for legacy implementation } else if (products[i].cartViewTagFired === undefined) { productsToFire.push(products[i]) // If the product is in the ddo.cart.item aray - update cartViewTagFired property const ddoMatch = ddoProducts.find(product => product.productInfo.productID === products[i].productID); if (ddoMatch) ddoMatch.attributes.cartViewTagFired = true; } }; _log('CartView event added to the dataCollector.', LOG_LEVEL.DEBUG); _pushToDataCollector({ 'event': 'cartview', data: { products: productsToFire } }); } /** * Captures all products out of the digitalData.cart.item array and fires a Coremetrics * Shop Action 9 tag for each one where cartViewTagFired property is true. Once tag has * fired, cartViewTagFired property is set to false, ensuring additional Shop Action 5 tags * can be fired. * @public * @returns {void} */ var productsPurchased = function () { const productsToFire = []; const products = ddo.get('cart.item', []); const cart = ddo.get('cart', {}); // currently application decision is only populated for the entire cart. // future state may require each product to contain it's own application decision const applicationDecision = cart.applicationDecision !== undefined ? cart.applicationDecision : cart.attributes.status !== undefined ? cart.attributes.status : undefined for (let i = 0, productsLen = products.length; i < productsLen; i++) { if (_toLowerCaseString(products[i].attributes.cartViewTagFired) !== 'false') { products[i].applicationDecision = applicationDecision productsToFire.push(products[i]); // Need to set this value to false to prevent from being included in subsequent productsPurchased events products[i].attributes.cartViewTagFired = false; }; }; _log('ProductsPurchased event added to the dataCollector.', LOG_LEVEL.DEBUG); _pushToDataCollector({ 'event': 'productsPurchased', data: { products: productsToFire } }); } /** * Sends a conversion event tag to Coremetrics. * @public * @requires eluminate.js * @requires cmdatatagutils.js * @param {object} conversion - Object with the conversion event details. * @param {string} conversion.eventName - The unique identifier for the type of conversion event. * @param {string} conversion.actionType - Indicates whether the conversion event was initiated or successfully completed. Valid values: initiate|complete * @param {string} conversion.category - Allows you to group events into a category. * @returns {void} */ var conversion = function (conversion) { _log('Conversion event added to the dataCollector.', LOG_LEVEL.DEBUG); _pushToDataCollector({ 'event': 'conversion', 'eventName': conversion.eventName, 'actionType': conversion.actionType, 'category': conversion.category }); } /** * Add products to the DDO without needing to manage the DDO structure. * Does not add if we find a product with a matching product ID already in the DDO. * @public * @param {string|number} productID - Unique identifier for the product. * @param {string} productName - Friendly name of the product. * @param {string} productCategory - Category product belongs to. * @returns {void} */ var addProducts = _addProducts; /** * Add products to the digitalData object (DDO) cart without needing to manage the DDO structure. * Does not add if we find a product with a matching product ID already in the DDO. * @public * @param {object|array} products * @param {string|number} product.productID - Unique identifier for the product. * @param {string} product.productName - Friendly name of the product. * @param {string} product.productCategory - Category product belongs to. * @returns {void} */ var addProductsToCart = _addProductsToCart; /** * Sets the value of a single segment within digitalData.page.pageInfo[n].segmentValue found by key. If key does not exist, a new segment will be created. * @public * @param {string} key - Key is the entire string up unti the first underscore in a segment section (e.g.: 'st' in '|st_NC|'). * @param {string} value - Vaue is the entire string after the first underscore in a segment section (e.g.: 'NC' in '|st_NC|'). * @param {number} [pageInfoArrayIndex=0] - Index of the pageInfo array from digitalData.page.pageInfo[n] you'd like the get the segment values from. * @returns {void} */ var addSegmentValue = _setSegmentValue; /** * Takes a segment string or array of segment strings and adds them to the * digitalData.page.pageInfo[n].segmentValue. If segment already exists, * updates the value. * @public * @param {string|array} segmentValues - Array of or single key/value string(s) seperated by an underscore (e.g.: ['olbc_Y', 'st_NC'], 'olbc_N'). * @param {number} [pageInfoArrayIndex=0] - Index of the pageInfo array from digitalData.page.pageInfo[n] you'd like the get the segment values from. * @returns {void} */ var addManySegmentValues = function (segmentValues, pageInfoArrayIndex) { if (!_isValidPageInfoArrayIndex(pageInfoArrayIndex)) pageInfoArrayIndex = 0; if (!Array.isArray(segmentValues)) segmentValues = [segmentValues]; for (var i = 0, segmentsLen = segmentValues.length; i < segmentsLen; i++) { var segment = _getSegmentKeyValue(_trim(segmentValues[i])); addSegmentValue(segment.key, segment.value, pageInfoArrayIndex); } } /** * Sends a Custom Error tag for the current page to Coremetrics. * @public * @requires eluminate.js * @requires cmdatatagutils.js * @param {string|number} errorCode - A unique identifier for the Error message. * @param {string} errorMessage - The text of the message that is displayed to the user. * @returns {void} */ var customError = function (errorCode, errorMessage) { var eventInfo = { 'event': 'customError' , 'errorCode': errorCode , 'errorMessage': errorMessage }; _pushToDataCollector(eventInfo); } /** * Sends a Manual Link Click tag on the current page to Coremetrics. * @public * @requires eluminate.js * @requires cmdatatagutils.js * @param {string} href - The href for the hyperlink. * @param {string} linkname - The unique descriptive identifier for the link. * @returns {void} */ var manualLinkClick = function (href, linkname) { var eventInfo = { 'event': 'manualLinkClick' , 'href': href , 'linkname': linkname }; _pushToDataCollector(eventInfo); } /** * Reverts the pageID Coremetrics is currently reporting on to the previous pageID. * For example, to be called when modal layer that called a second Pageview tag in * a single DOM instance is closed. * @public * @requires eluminate.js * @param {number} [pageInfoArrayIndex] - Index of the pageInfo array from * digitalData.page.pageInfo[n] you'd like the get the pageID from. * @returns {void} */ var revertToPrevPageID = function (pageInfoArrayIndex) { if (typeof cG7 === 'undefined') { _log('cG7 is undefined. Unable to call revertToPrevPageID() until Coremetrics libraries are ready.', LOG_LEVEL.WARN); } else { _revertToPreviousPageID(pageInfoArrayIndex); } } /** * reportError - reporting Errors to the data collector to make functions fail silently * @public * @param {object} - Error data that is caught from a throw or failed try * @returns {void} */ var reportError = function (error, options) { try { if (typeof error === "object" && error.name && error.message && error.stack && (window.bactm_envSelector !== "prod" || window.location.href.indexOf('debug=true') > -1)) { window.reportError(error) // Commented out the code below due to traffic concerns, should revisit if Celebrus can handle this traffic. if (options?.record === true) { var spliceErrorString = function spliceErrorString(errorString, errArray) { if (!errArray) errArray = []; var modifiedErrorString = errorString.slice(errorString.indexOf('at ') + 3); var functionName = modifiedErrorString.slice(0, modifiedErrorString.indexOf(' ')); var location = modifiedErrorString.slice(modifiedErrorString.indexOf('(') + 1, modifiedErrorString.indexOf(')')); modifiedErrorString = modifiedErrorString.substring(modifiedErrorString.indexOf(')')); errArray.push({ functionName: functionName, location: location }); if (modifiedErrorString.indexOf(')') > -1) { spliceErrorString(modifiedErrorString, errArray); } return errArray; }; var errCategory = error.name; var errMessage = error.message; var errString = error.stack.toString(); var errStack = spliceErrorString(errString); var errData = { errCategory: errCategory, errMessage: errMessage, errStack: errStack }; var dataToReport = { event: 'Bactm_Error', data: errData }; _pushToDataCollector(dataToReport); } } } catch (error) { if (typeof error === "object" && error.name && error.message && error.stack) { window.reportError(error); } } }; /** * chat_dataCollector - Array that logs all genesys events * @public * @returns {void} */ var chat_dataCollector = []; /** * Rescans the DOM and adds event handlers to anchor tags for Automatic Link Click tag * functionality. * @public * @requires eluminate.js * @returns {void} */ var rescanDOM = function () { _rescanDOM(); } /** * Sends data to a transparent gif on the webservers so data can be pulled from the server * logs via Splunk. * @public * @returns {void} */ var log = function (data) { var eventInfo = { 'event': 'log' , 'data': data }; var _timestamp = function () { var e = new Date; return e.getTime() - e.getTimezoneOffset() } if (!Array.isArray(data) && typeof data === 'object' && !('ts' in data)) data.ts = _timestamp(); _pushToDataCollector(eventInfo); } // =========================================================================== // End public functions. // =========================================================================== const _setBactmEventListeners = () => { window.addEventListener('bactm.addManySegmentValues', ({ detail }) => { addManySegmentValues(detail.segmentValues, detail.pageInfoArrayIndex) }); window.addEventListener('bactm.addProducts', ({ detail }) => addProducts(detail)); window.addEventListener('bactm.addProductsToCart', ({ detail }) => addProductsToCart(detail)); window.addEventListener('bactm.addSegmentValue', ({ detail }) => addSegmentValue(detail.key, detail.value, detail.pageInfoArrayIndex)); window.addEventListener('bactm.cartView', () => cartView()); window.addEventListener('bactm.conversion', ({ detail }) => conversion(detail)); window.addEventListener('bactm.customError', ({ detail }) => customError(detail.errorCode, detail.errorMessage)); window.addEventListener('bactm.customEvent', ({ detail }) => _raiseCustomEvent(detail.eventKey, detail.details)); window.addEventListener('bactm.impressions', ({ detail = false }) => _impressions(detail)); window.addEventListener('bactm.manualLinkClick', ({ detail }) => manualLinkClick(detail.href, detail.linkname)); window.addEventListener('bactm.pageID', ({ detail }) => { _pageIDHistory(detail.command, detail.pageInfoArrayIndex, detail.pageID) }); window.addEventListener('bactm.pageview', ({ detail }) => pageview(detail.pageInfoKey, detail.options)); window.addEventListener('bactm.productsPurchased', () => productsPurchased()); window.addEventListener('bactm.productview', () => productview()); window.addEventListener('bactm.rescanDOM', () => rescanDOM()); window.addEventListener('bactm.revertToPrevPageID', ({ detail }) => revertToPrevPageID(detail)); } // Catch cases where libraries have loaded after the browser dom ready event has already occurred. // Enables bactm.ready(); functionality. if (doc.readyState === "complete" || (doc.readyState !== "loading" && !doc.documentElement.doScroll)) { _onDomReady(); } else { // Use the handy event callback doc.addEventListener("DOMContentLoaded", _domLoadComplete); } // "Core" functions which will always be exported and available no matter any other settings. var core = { 'env': env , 'plugins': plugins , 'ready': _ready , 'on': _listener , 'trigger': _trigger , 'Store': Store , 'Cookies': Cookies , 'PixelTag': PixelTag , 'Ajax': Ajax , 'QueryString': QueryString , 'SudoPromise': SudoPromise , 'customEvent': _raiseCustomEvent , 'ddo': ddo , 'polyfills': polyfills , 'log': log , 'setApplicationDetails': _setApplicationDetails , 'getApplicationId': _getApplicationId , 'setPrivacy': _setPrivacy , 'decomposeUri': decomposeUri , 'reportError': reportError , 'chat_dataCollector': chat_dataCollector , 'pageID': _pageIDHistory , 'scriptReady': _scriptReady // Private functions exposed for plugins to access. , '_getPageInfo': _getPageInfo , '_isValidPageInfoArrayIndex': _isValidPageInfoArrayIndex , '_log': _log , '_readCookie': _readCookie , '_asArray': _asArray , '_sendLogBeacon': _sendLogBeacon } // Export public functions. var bactm = { 'pageview': pageview , 'addManySegmentValues': addManySegmentValues , 'addProducts': addProducts , 'addProductsToCart': addProductsToCart , 'addSegmentValue': addSegmentValue , 'cartView': cartView , 'conversion': conversion , 'customError': customError , 'manualLinkClick': manualLinkClick , 'rescanDOM': rescanDOM , 'productsPurchased': productsPurchased , 'productview': productview , 'revertToPrevPageID': revertToPrevPageID , 'impressions': _impressions } // Merge in our core functions to be exposed publically. for (var key in core) { if (core.hasOwnProperty(key)) bactm[key] = core[key]; } // Export legacy functions to the window for backwards compatability. win['cm_NormalizeList'] = 'sessionid=;pageID=;accessToken=;token=;adx=;features=;request_locale=;deviceCode=;phoneNumber=;emailAddress=;callback=;divId=;qry=;tid=;dropdown-loan=;gclid=;currencyInputField=;rq=;searchText=;'; win['bactm_evtSel'] = 1; win['bactm_addSegmentationValues'] = _bactmAddSegmentationValues; win['bactm_beginDataCollection'] = _beginDataCollection; win['bactm_capturePageview'] = _capturePageview; win['bactm_captureAddlPageview'] = _captureAdditionalPageview; win['bactm_captureDynamicPageview'] = _captureDynamicPageview; win['bactm_loadDataCollection'] = _loadDataCollection; win['bactm_addProducts'] = _bactmAddProducts; win['bactm_captureCustomError'] = customError; win['bactm_createManualLinkClickTag'] = manualLinkClick; win['bactm_restorePageID'] = revertToPrevPageID; win['bactm_productView'] = _bactmProductView; // Run our initialization function. _init(); return bactm; }); } catch(e){ console.log(e) } }catch(e){console.log(e);}} if(!utag_condload){try{ try{ /** * Tealium extension to map the Bank's digitalData data layer to Tealium's utag_data universal data object. * @version 1.0.6 * @revised 10-18-2024 * @author Chris Capps * @author Luis Perez * */ try { //Ignore keys in the data layer that start with the following text. //Expecting an array of strings //["event","ac"] var ignore_keys = []; //Specify a prefix for data layer elements being sent to the utag_data object. //Instead of utag_data.productID, it could be utag_data.dl_productID var prefix = ""; //In cases of a nested object, what should join the parent key and child key var nested_delimeter = "."; //Specify the data layer object name var data_layer = "digitalData"; //Specify the Tealium data layer name var tealium_object = "utag_data"; //Use the global environment selector to determine whether to log stuff or not //TODO: Change to a const or let once we have transpile in place var tealium_debug = (window.bactm_envSelector === "prod") ? false : true; /** * This function overrides the default console log statement * @param {string} message the message to be logged * @returns {undefined} */ function log(message) { if (tealium_debug) { console.log(message); } } /** * This function harvests the pageID, if one is available, or sets document.title as the pageID * @param {string} pageID the pageID, should always come in undefined * @returns {string} pageID set either to the global Coremetrics Object or document.title */ function getPageID(pageID) { if (window.cG7 && cG7.cM0) { pageID = window.cG7.cM0[cm_ClientID]; } else { pageID = document.title; } return pageID; } //*****************DO NOT MODIFY BELOW*********************** // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys // Add the Object.keys method for older versions of IE if (!Object.keys) { Object.keys = (function () { 'use strict'; var hasOwnProperty = Object.prototype.hasOwnProperty, hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'), dontEnums = [ 'toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor' ], dontEnumsLength = dontEnums.length; return function (obj) { if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) { throw new TypeError('Object.keys called on non-object'); } var result = [], prop, i; for (prop in obj) { if (hasOwnProperty.call(obj, prop)) { result.push(prop); } } if (hasDontEnumBug) { for (i = 0; i < dontEnumsLength; i++) { if (hasOwnProperty.call(obj, dontEnums[i])) { result.push(dontEnums[i]); } } } return result; }; }()); } //Ensure the tealium_object is available. window[tealium_object] = window[tealium_object] || {}; function ignoreKey(key) { var should_ignore_key = 0; //Loop through the ignore_keys array to see if we should ignore this key for (var k = 0; k < ignore_keys.length; k++) { var re = new RegExp("^" + ignore_keys[k]); if (key.match(re)) { should_ignore_key = 1; try { log('Ignoring key: ' + key); } catch (e) { bactm.reportError(e); } } } return should_ignore_key; } function processDataObject(obj, parent_key) { if (typeof parent_key === "undefined") { //This object isn't nested in another object parent_key = ""; } else { //Add the nested_delimeter to the parent key parent_key += "" + nested_delimeter; } Object.keys(obj).forEach(function (key) { var nested_key_name = parent_key + key; var new_key_name = prefix + parent_key + key; if (typeof obj[key] !== 'undefined' && obj[key] != null) { if ((typeof obj[key]).match(/boolean|string|number/) && !ignoreKey(key)) { //If the value of the key is a boolean or a string or a number and //the key shouldn't be ignored add to the data layer window[tealium_object][new_key_name] = "" + obj[key]; //Force value to be a string } else if (obj[key].constructor === Object && !ignoreKey(key)) { //Process this piece of the data layer and merge it processDataObject(obj[key], nested_key_name); } else if (obj[key].constructor === Array) { processDataArray(obj[key], nested_key_name); } } }); } function processDataArray(obj, parent_key) { if (typeof parent_key === "undefined") { //This object isn't nested in another object parent_key = ""; } else { //Add the nested_delimeter to the parent key parent_key += "" + nested_delimeter; } var new_key_name = prefix + parent_key; for (var n = 0; n < obj.length; n++) { if ((typeof obj[n]).match(/boolean|string|number/)) { //First check to see if this key exists if (typeof window[tealium_object][new_key_name] === "undefined") { //Make the key an array window[tealium_object][new_key_name] = []; } //If the value of the key is a boolean or a string or a number and //the key shouldn't be ignored add to the data layer window[tealium_object][new_key_name].push("" + obj[n]); } else if (typeof obj[n] !== 'undefined' && obj[n] != null && obj[n].constructor === Object) { Object.keys(obj[n]).forEach(function (array_key) { var new_obj = obj[n]; array_key_name = new_key_name + array_key; if (typeof new_obj[array_key] !== 'undefined' && new_obj[array_key] != null) { if ((typeof new_obj[array_key]).match(/boolean|string|number/) && !ignoreKey(array_key)) { //First check to see if this key exists if (typeof window[tealium_object][array_key_name] === "undefined") { //Make the key an array window[tealium_object][array_key_name] = []; } //If the value of the key is a boolean or a string or a number and //the key shouldn't be ignored add to the data layer window[tealium_object][array_key_name].push("" + new_obj[array_key]); } else if (new_obj[array_key].constructor === Array) { processDataArray(new_obj[array_key], array_key_name); } } }); } } } /** * This function determines whether the data layer is an array or object and calls the appropriate function * @returns {undefined} */ function processDataLayer() { if (window[data_layer]?.page?.attributes?.hasOwnProperty('chat') && window[data_layer].page.attributes.chat.hasOwnProperty('site_id') && window[data_layer].page.attributes.chat.site_id === null && window.location.href.indexOf('mycustomerassistance') > -1) { window[data_layer].page.attributes.chat.site_id = '99999999'; } else if (window[data_layer]?.page?.attributes?.hasOwnProperty('chat') && window[data_layer].page.attributes.chat.hasOwnProperty('site_id') && window[data_layer].page.attributes.chat.site_id === null) { window[data_layer].page.attributes.chat.site_id = undefined; } // the following two conditionals is to make sure that the site id key is not case sensitive if (window[data_layer]?.page?.attributes?.hasOwnProperty('chat') && window[data_layer].page.attributes.chat.hasOwnProperty('site_id')) { window[data_layer].page.attributes.chat.SITE_ID = window[data_layer].page.attributes.chat.site_id; } if (window[data_layer]?.page?.attributes?.hasOwnProperty('chat') && window[data_layer].page.attributes.chat.hasOwnProperty('SITE_ID')) { window[data_layer].page.attributes.chat.site_id = window[data_layer].page.attributes.chat.SITE_ID; } if (window[data_layer]?.constructor === Array) { for (var i = 0; i < window[data_layer].length; i++) { processDataObject(window[data_layer][i]); } } else { processDataObject(window[data_layer]); } } //Check if the page data layer exists if (typeof window[data_layer] !== 'undefined') { processDataLayer(); } else { //Print a message stating that the data layer object doesn't exist try { log('Error "' + data_layer + '" doesn\'t exist on the page. A default one was created'); window[data_layer] = { pageInstanceID: "", page: { pageInfo: [{ pageID: getPageID() }], category: {}, attributes: {} }, product: [], cart: {}, event: {}, user: {}, version: "BAC_0.25" }; window.bactm.setPrivacy(); processDataLayer(); } catch (e) { bactm.reportError(e); } } if (window.bactm) { const bactmEvent = new CustomEvent("bactm_libload", { detail: 'bactm has loaded' }); document.dispatchEvent(bactmEvent); } } catch (e) { try { log('Error trying to convert data layer: ' + e); bactm.reportError(e); } catch (e) {}; } } catch(e){ console.log(e) } }catch(e){console.log(e);}} if(!utag_condload){try{ try{ try { // mask all these below. If a page has window.gisMasking = true, most likely we'll block the whole page, need to confirm that though. const maskClasses = [ ".gis-mask", ".gis-mask-original", ".gis-mask-input", ".tl-private" ] const maskIds = []; const glanceVersion = "6.48.0M"; const maskDataAttributes = [ "[data-gis-mask='true']" ]; const maskSelectors = maskClasses.concat(maskIds.concat(maskDataAttributes)); if (bactm_envSelector === "prod"){ digitalData = window.digitalData || {}; digitalData.page = window.digitalData.page || {}; digitalData.page.attributes = window.digitalData.page.attributes || {}; digitalData.page.attributes.glance = { ws: "www.glance.net", version: glanceVersion, groupID: "21494", src: "https://storage.glancecdn.net/cobrowse/js/GlanceCobrowseLoader_" + glanceVersion + ".js", env: "production", maskSelectors: maskSelectors, } } else { digitalData = window.digitalData || {}; digitalData.page = window.digitalData.page || {}; digitalData.page.attributes = window.digitalData.page.attributes || {}; digitalData.page.attributes.glance = { ws: "www-bofa.myglance.net", version: glanceVersion, groupID: "21506", src: "https://cdn-bofa.myglance.net/cobrowse/js/GlanceCobrowseLoader_" + glanceVersion + ".js", env: "production", maskSelectors: maskSelectors, } } } catch (e) {} } catch(e){ console.log(e) } }catch(e){console.log(e);}} if (typeof utag == "undefined" && !utag_condload) { var utag = { id:"bofa.olb", o:{}, sender: {}, send: {}, rpt: { ts: { a: new Date() } }, dbi: [], db_log : [], loader: { q: [], lc: 0, f: {}, p: 0, ol: 0, wq: [], lq: [], bq: {}, bk: {}, rf: 0, ri: 0, rp: 0, rq: [], ready_q : [], sendq :{"pending":0}, run_ready_q : function(){ for(var i=0;i 0) { g.push(b); //utag.loader.AS(b); // moved: defer loading until flags cleared d++; }else{ // clear flag for those set to wait that were not actually loaded this.f[b.id]=1; } } for (a = 0; a < g.length; a++) { utag.loader.AS(g[a]); } if(d==0){ utag.loader.END(); } }, AS: function(a, b, c, d) { utag.send[a.id] = a; if (typeof a.src == 'undefined' || !utag.ut.hasOwn(a,'src')) { a.src = utag.cfg.path + ((typeof a.name != 'undefined') ? a.name : 'ut' + 'ag.' + a.id + '.js') } a.src += (a.src.indexOf('?') > 0 ? '&' : '?') + 'utv=' + (a.v?utag.cfg.template+a.v:utag.cfg.v); utag.rpt['l_' + a.id] = a.src; b = document; this.f[a.id]=0; if (a.load == 2) { utag.DB("Attach sync: "+a.src); a.uid=a.id; b.write('